/**
 * Comerziofy - Product Detail & Dropcod Styles
 * Extracted from renderProductDetail()
 * Dynamic vars (--store-primary, --store-primary-dark) defined inline in PHP
 */

/* Dropcod Modal Styles */
.dropcod-modal *,
.dropcod-modal *::before,
.dropcod-modal *::after {
    box-sizing: border-box;
}

.dropcod-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

.dropcod-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.dropcod-modal {
    position: relative;
    background: #fefefe;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s ease;
    margin: auto;
}

.dropcod-modal.active {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.dropcod-modal-close-bar {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 2;
}

.dropcod-modal-header {
    display: block;
    padding: 12px 18px;
    font-size: 14px;
    color: #000;
}

.dropcod-modal-header span {
    display: inline;
}

.dropcod-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #4d4d4d;
    cursor: pointer;
    line-height: 1;
    font-weight: 700;
    padding: 0;
}

.dropcod-modal-close:hover {
    color: #000;
}

.dropcod-modal-body {
    padding: 10px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dropcod-product-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #d9d9d9;
}

.dropcod-product-row + .dropcod-product-row[data-cu-item] {
    padding-top: 4px;
}

.dropcod-product-row:has(+ .dropcod-product-row[data-cu-item]) {
    padding-bottom: 4px;
}

.dropcod-product-img {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #06b6d4, #10b981);
    border-radius: 6px;
    flex-shrink: 0;
    position: relative;
    background-size: cover;
    background-position: center;
}


.dropcod-product-qty {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #6366f1;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropcod-product-info {
    flex: 1;
    min-width: 0;
}

.dropcod-product-name {
    display: block;
    font-size: 14px;
    color: #000;
    text-decoration: underline;
    line-height: 1.2;
}

.dropcod-product-variant {
    font-size: 13px;
    color: #7b7b7b;
}

.dropcod-product-price {
    font-weight: 600;
    color: #000;
    font-size: 14px;
}

.dropcod-summary-section {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #d3d3d3;
}

.dropcod-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #000;
    padding: 4px 0;
}

.dropcod-summary-row.total {
    font-weight: 700;
    font-size: 16px;
    border-top: 1px solid rgba(175, 175, 175, 0.34);
    margin-top: 6px;
    padding-top: 10px;
}

.dropcod-section-label {
    font-size: 14px;
    color: #000;
    margin-bottom: 8px;
}

.dropcod-shipping-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 5px;
    border: 1px solid #d9d9d9;
    cursor: pointer;
    margin-bottom: 8px;
}

.dropcod-shipping-option:last-child {
    margin-bottom: 0;
}

.dropcod-shipping-option.selected {
    border-color: #000;
}

.dropcod-shipping-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid black;
    border-radius: 50%;
    margin: 0;
    position: relative;
    flex-shrink: 0;
}

.dropcod-shipping-option input[type="radio"]:checked::before {
    content: "";
    width: 10px;
    height: 10px;
    background: #000;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dropcod-shipping-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.dropcod-shipping-name {
    font-weight: 500;
    color: #000;
    font-size: 14px;
    line-height: 1.3;
}

.dropcod-shipping-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
    margin-top: 2px;
}

.dropcod-shipping-price {
    margin-left: auto;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    flex-shrink: 0;
}

.dropcod-shipping-price.free {
    color: #000000;
    font-weight: 600;
}

.dropcod-form-field label {
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    display: flex !important;
    align-items: center;
    height: 100%;
    color: #000;
    margin-bottom: 4px;
    -webkit-user-select: none;
    user-select: none;
    word-wrap: break-word;
}

.dropcod-form-field label .required {
    color: #e20000;
    margin-left: 2px;
}

.dropcod-form-field input {
    width: 100%;
    height: 45px;
    padding: 5px 15px;
    border: 1px solid #c0c0c0;
    border-radius: 6px;
    font-size: 16px;
    background: #fff;
    color: #000;
    font-family: inherit;
}

.dropcod-form-field textarea {
    font-family: inherit;
}

.dropcod-form-field input::placeholder,
.dropcod-form-field textarea::placeholder {
    color: #616161;
    font-family: inherit;
}

.dropcod-input-with-icon {
    display: flex;
}

.dropcod-input-with-icon i {
    width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e1e1e1;
    border: 1px solid #c0c0c0;
    border-right: none;
    border-radius: 6px 0 0 6px;
    color: #000;
    font-size: 14px;
}

.dropcod-input-with-icon input {
    flex: 1;
    border-radius: 0 6px 6px 0;
    padding-left: 12px;
}

.dropcod-input-with-icon i[style*="display:none"]+input,
.dropcod-input-with-icon i[style*="display: none"]+input {
    border-radius: 6px;
}

.dropcod-select-wrapper select {
    width: 100%;
    height: 45px;
    padding: 5px 15px;
    padding-right: 40px;
    border: 1px solid #c0c0c0;
    border-radius: 6px;
    font-size: 16px;
    background: #fff;
    color: #000;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 0 24 24' width='24' fill='%23000'%3e%3cpath d='M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.dropcod-checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 8px;
}

.dropcod-form-field.dropcod-privacy-policy .dropcod-pp-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    padding: 0;
    border: revert;
    border-radius: revert;
    font-size: revert;
}

.dropcod-checkbox-text {
    flex: 1;
    font-size: 14px;
    color: #000;
    line-height: 1.5;
}

.dropcod-checkbox-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0 10px;
}

.dropcod-modal-footer {
    padding: 0;
}

.dropcod-submit-btn {
    width: 100%;
    min-height: 50px;
    padding: 10px 0;
    background: #000;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s;
}

.dropcod-submit-btn:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

.dropcod-wa-submit:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.dropcod-submit-btn i {
    font-size: 14px;
}

.dropcod-submit-main-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dropcod-submit-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

.btn-dropcod-cod {
    width: 100%;
    padding: 18px 24px;
    border: none;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-dropcod-cod:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-dropcod-subtitle {
    width: 100%;
    text-align: center;
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

.btn-auto-pulse {
    animation: dropcod-pulse 2s ease-in-out infinite;
}

.btn-auto-bounce {
    animation: dropcod-bounce 1s ease infinite;
}

.btn-auto-shake {
    animation: dropcod-shake 0.5s ease-in-out infinite;
}

@keyframes dropcod-pulse {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.02)
    }
}

@keyframes dropcod-bounce {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-5px)
    }
}

@keyframes dropcod-shake {

    0%,
    100% {
        transform: translateX(0)
    }

    25% {
        transform: translateX(-3px)
    }

    75% {
        transform: translateX(3px)
    }
}

/* ===== MOBILE MODAL - Formulario completo visible con scroll ===== */
@media (max-width: 768px) {
    .dropcod-modal-overlay {
        padding: 20px 12px;
        align-items: flex-start;
    }

    .dropcod-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 16px;
        margin: 0;
    }

    .dropcod-modal-header {
        padding: 16px 18px;
        font-size: 15px;
        font-weight: 600;
        border-radius: 16px 16px 0 0;
    }

    .dropcod-modal-close {
        font-size: 26px;
        padding: 2px;
    }

    .dropcod-modal-body {
        padding: 16px 18px 18px;
        gap: 16px;
    }

    .dropcod-modal-footer {
        padding: 0;
    }

    .dropcod-product-img {
        width: 58px;
        height: 58px;
    }

    .dropcod-product-name {
        font-size: 14px;
    }

    .dropcod-summary-section {
        padding: 12px;
    }

    .dropcod-summary-row {
        font-size: 14px;
        padding: 4px 0;
    }

    .dropcod-summary-row.total {
        font-size: 16px;
    }

    .dropcod-form-field label {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .dropcod-form-field input,
    .dropcod-select-wrapper select {
        height: 48px;
        font-size: 16px;
        /* Previene zoom en iOS */
        border-radius: 8px;
    }

    .dropcod-input-with-icon i {
        width: 44px;
        border-radius: 8px 0 0 8px;
    }

    .dropcod-input-with-icon input {
        border-radius: 0 8px 8px 0;
    }

    .dropcod-input-with-icon i[style*="display:none"]+input,
    .dropcod-input-with-icon i[style*="display: none"]+input {
        border-radius: 8px;
    }

    .dropcod-shipping-option {
        padding: 12px;
    }

    .dropcod-checkbox-text {
        font-size: 13px;
    }

    .dropcod-submit-btn {
        min-height: 52px;
        font-size: 16px;
        font-weight: 600;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .dropcod-modal-overlay {
        padding: 15px 10px;
    }

    .dropcod-modal {
        border-radius: 14px;
    }

    .dropcod-modal-header {
        padding: 14px 16px;
        border-radius: 14px 14px 0 0;
    }

    .dropcod-modal-body {
        padding: 14px 16px 16px;
        gap: 14px;
    }

    .dropcod-modal-footer {
        padding: 0;
    }

    .dropcod-product-img {
        width: 52px;
        height: 52px;
    }

    .dropcod-product-qty {
        width: 20px;
        height: 20px;
        font-size: 11px;
        top: -5px;
        right: -5px;
    }
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

@keyframes btn-pulse {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.03)
    }
}

@keyframes btn-shake {

    0%,
    100% {
        transform: translateX(0)
    }

    20%,
    60% {
        transform: translateX(-3px)
    }

    40%,
    80% {
        transform: translateX(3px)
    }
}

@keyframes btn-glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(255, 255, 255, .2)
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 255, 255, .6)
    }
}

@keyframes btn-bounce {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-4px)
    }
}

@keyframes btn-shake-y {

    0%,
    100% {
        transform: translateY(0)
    }

    20%,
    60% {
        transform: translateY(-3px)
    }

    40%,
    80% {
        transform: translateY(3px)
    }
}

@keyframes btn-shake-bottom {

    0%,
    100% {
        transform: translateY(0)
    }

    25% {
        transform: translateY(4px)
    }

    50% {
        transform: translateY(0)
    }

    75% {
        transform: translateY(4px)
    }
}

@keyframes btn-fanfare {

    0%,
    100% {
        transform: scale(1) rotate(0deg)
    }

    10% {
        transform: scale(1.05) rotate(-2deg)
    }

    20% {
        transform: scale(1.08) rotate(2deg)
    }

    30% {
        transform: scale(1.05) rotate(-1deg)
    }

    40% {
        transform: scale(1) rotate(0deg)
    }
}

@keyframes btn-heartbeat {

    0%,
    100% {
        transform: scale(1)
    }

    14% {
        transform: scale(1.06)
    }

    28% {
        transform: scale(1)
    }

    42% {
        transform: scale(1.06)
    }

    70% {
        transform: scale(1)
    }
}

@keyframes btn-jello {

    0%,
    100% {
        transform: skewX(0) skewY(0)
    }

    30% {
        transform: skewX(-5deg) skewY(-5deg)
    }

    40% {
        transform: skewX(4deg) skewY(4deg)
    }

    50% {
        transform: skewX(-3deg) skewY(-3deg)
    }

    65% {
        transform: skewX(2deg) skewY(2deg)
    }

    75% {
        transform: skewX(-1deg) skewY(-1deg)
    }
}

@keyframes btn-swing {

    0%,
    100% {
        transform: rotate(0deg)
    }

    20% {
        transform: rotate(5deg)
    }

    40% {
        transform: rotate(-4deg)
    }

    60% {
        transform: rotate(2deg)
    }

    80% {
        transform: rotate(-1deg)
    }
}

@keyframes btn-bottom-shaking {

    0%,
    100% {
        transform: translateY(0)
    }

    25% {
        transform: translateY(3px)
    }

    50% {
        transform: translateY(0)
    }

    75% {
        transform: translateY(3px)
    }
}