/* ========================================
   WooCommerce Sidebar Cart - Estilos
   ======================================== */

/* ========== Variables ========== */
:root {
    --wsc-primary: #534dfa;
    --wsc-primary-dark: #4845b5;
    --wsc-text-dark: #1a1a1a;
    --wsc-text-light: #666;
    --wsc-border: #e0e0e0;
    --wsc-bg-light: #f5f5f5;
    --wsc-white: #ffffff;
    --wsc-shadow: rgba(0, 0, 0, 0.1);
    --wsc-overlay: rgba(0, 0, 0, 0);
}

/* ========== Botón del Carrito ========== */
.wsc-cart-button-wrapper {
    display: inline-block;
}

.wsc-cart-trigger {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.wsc-cart-trigger:hover {
    opacity: 0.8;
}

.wsc-icon-user,
.wsc-icon-cart {
    width: 24px;
    height: 24px;
    color: var(--wsc-white);
}

.wsc-cart-icon-wrapper {
    position: relative;
}

.wsc-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--wsc-primary);
    color: var(--wsc-white);
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.wsc-cart-text {
    color: var(--wsc-white);
    font-size: 14px;
    font-weight: 500;
}

/* ========== Overlay ========== */
.wsc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height para móviles */
    background: var(--wsc-overlay);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* ========== Sidebar del Carrito ========== */
.wsc-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height para móviles */
    background: var(--wsc-white);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px var(--wsc-shadow);
    transition: right 0.3s ease;
}

.wsc-sidebar.active {
    right: 0;
    z-index: 99999;
}

/* ========== Header ========== */
.wsc-header {
    background: #534dfa;
    color: var(--wsc-white);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.wsc-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color:white;
    letter-spacing: 0.5px;
}

.wsc-close {
    background: transparent;
    border: none;
    color: var(--wsc-white);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.wsc-close:hover {
    opacity: 0.8;
}

.wsc-close svg {
    width: 20px;
    height: 20px;
}

/* ========== Contenido del Carrito ========== */
.wsc-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.wsc-content::-webkit-scrollbar {
    width: 6px;
}

.wsc-content::-webkit-scrollbar-track {
    background: var(--wsc-bg-light);
}

.wsc-content::-webkit-scrollbar-thumb {
    background: var(--wsc-border);
    border-radius: 3px;
}

.wsc-content::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Carrito vacío */
.wsc-empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: var(--wsc-text-light);
}

.wsc-empty-cart p {
    margin: 0;
    font-size: 16px;
}

/* ========== Items del Carrito ========== */
.wsc-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wsc-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--wsc-border);
}

.wsc-item:last-child {
    border-bottom: none;
}

/* Botón eliminar */
.wsc-remove-item {
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
    border: none;
    color: #24272d;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
        border: 1px solid #ccc;
        background-color: #dedfea;
    border-radius: 50%;
    position: absolute;
    transition: color 0.2s ease;
}

/* Imagen del producto */
.wsc-item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    margin-left: 10px;
}

.wsc-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Detalles del producto */
.wsc-item-details {
    flex: 1;
    display: flex;    
    gap: 0px;
        flex-direction: row;
    justify-content: space-between;
    align-items: start;
}

.wsc-item-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--wsc-text-dark);
    line-height: 1.3;
    text-decoration: none;
    margin-bottom: 5px;
}

.wsc-item-attributes {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 0px;
}

.wsc-attribute {
    font-size: 12px;
    color: var(--wsc-text-light);
}

.wsc-item-options {
    font-size: 12px;
    color: white;
    background-color: #534dfa;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    align-self: flex-start;
    cursor: pointer;
    padding: 5px 10px;
    margin-bottom: 8px;
}

.wsc-item-options:hover {
    text-decoration: none;
}

/* Footer del item */
.wsc-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

/* Control de cantidad */
.wsc-quantity {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--wsc-border);
    border-radius: 4px;
    overflow: hidden;
}

.wsc-qty-btn {
    background: var(--wsc-white);
    border: none;
    color: var(--wsc-text-dark);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s ease;
}

.wsc-qty-btn:hover {
    background: var(--wsc-bg-light);
}

.wsc-qty-input {
    width: 40px;
    height: 32px;
    border: none;
    border-left: 1px solid var(--wsc-border);
    border-right: 1px solid var(--wsc-border);
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    -moz-appearance: textfield;
}

.wsc-qty-input::-webkit-outer-spin-button,
.wsc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Precio del item */
.wsc-item-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--wsc-text-dark);
}

/* ========== Footer ========== */
.wsc-footer {
    background: var(--wsc-white);
    border-top: 1px solid var(--wsc-border);
    flex-shrink: 0;
}

.wsc-footer .wsc-coupon-section, .wsc-footer .wsc-footer-two {
        padding: 16px;
}

.wsc-footer .wsc-footer-two{
background-color: black;
color:white;
}

/* Sección de cupón */
.wsc-coupon-section {
    border-bottom: 1px solid var(--wsc-border);
    padding-bottom: 16px;
}

.wsc-coupon-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--wsc-text-dark);
    font-weight: 500;
}

.wsc-coupon-arrow {
    transition: transform 0.3s ease;
}

.wsc-coupon-toggle.active .wsc-coupon-arrow {
    transform: rotate(180deg);
}

.wsc-coupon-form {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.wsc-coupon-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--wsc-border);
    border-radius: 4px;
    font-size: 14px;
}

.wsc-coupon-input::placeholder {
    color: var(--wsc-text-light);
}

.wsc-coupon-apply {
    background: #534dfa;
    color: var(--wsc-white);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wsc-coupon-apply:hover {
    background: var(--wsc-primary-dark);
}

/* Subtotal */
.wsc-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
}

.wsc-subtotal-label {
    font-size: 15px;
    font-weight: 600;
    color: white
}

.wsc-subtotal-amount {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

/* Nota de impuestos */
.wsc-tax-note {
    font-size: 11px;
    color: white;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

/* Botón de checkout */
.wsc-checkout-btn {
    display: block;
    width: 100%;
    background: #534dfa;
    color: var(--wsc-white);
    text-align: center;
    text-decoration: none;
    padding: 14px 20px;
    border-radius: 6px;
    max-width: -webkit-fill-available;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.wsc-checkout-btn:hover {
    background: var(--wsc-primary-dark);
}

/* ========== Responsive ========== */
@media (max-width: 480px) {
    .wsc-sidebar {
        max-width: 100%;
        right: -100%;
    }
    
    .wsc-item-image {
        width: 60px;
        height: 60px;
    }
    
    .wsc-item-name {
        font-size: 13px;
    }
}

/* ========== Loading State ========== */
.wsc-loading {
    pointer-events: none;
    opacity: 0.6;
}

.wsc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--wsc-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: wsc-spin 0.6s linear infinite;
}

@keyframes wsc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== Modal de Variaciones ========== */
.wsc-variation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wsc-variation-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--wsc-overlay);
}

.wsc-variation-modal-content {
    position: relative;
    background: var(--wsc-white);
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px var(--wsc-shadow);
    animation: wsc-modal-slide-in 0.3s ease;
}

@keyframes wsc-modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wsc-variation-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--wsc-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wsc-variation-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--wsc-text-dark);
}

.wsc-variation-modal-close {
    background: transparent;
    border: none;
    color: var(--wsc-text-light);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.wsc-variation-modal-close:hover {
    color: var(--wsc-text-dark);
}

.wsc-variation-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.wsc-variation-modal-body::-webkit-scrollbar {
    width: 6px;
}

.wsc-variation-modal-body::-webkit-scrollbar-track {
    background: var(--wsc-bg-light);
}

.wsc-variation-modal-body::-webkit-scrollbar-thumb {
    background: var(--wsc-border);
    border-radius: 3px;
}

.wsc-variation-option-group {
    margin-bottom: 20px;
}

.wsc-variation-option-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--wsc-text-dark);
    margin-bottom: 10px;
}

.wsc-variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wsc-variation-option {
    padding: 10px 16px;
    border: 2px solid var(--wsc-border);
    border-radius: 6px;
    background: var(--wsc-white);
    color: var(--wsc-text-dark);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wsc-variation-option:hover {
    border-color: var(--wsc-primary);
    background: var(--wsc-bg-light);
}

.wsc-variation-option.selected {
    border-color: var(--wsc-primary);
    background: var(--wsc-primary);
    color: var(--wsc-white);
    font-weight: 600;
}

.wsc-variation-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.wsc-variation-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--wsc-border);
}

.wsc-variation-update-btn {
    width: 100%;
    background: var(--wsc-primary);
    color: var(--wsc-white);
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wsc-variation-update-btn:hover {
    background: var(--wsc-primary-dark);
}

.wsc-variation-update-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wsc-variation-price {
    margin-top: 10px;
    padding: 12px;
    background: var(--wsc-bg-light);
    border-radius: 6px;
    text-align: center;
}

.wsc-variation-price-label {
    font-size: 12px;
    color: var(--wsc-text-light);
    margin-bottom: 4px;
}

.wsc-variation-price-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--wsc-primary);
}

.wsc-variation-stock-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.wsc-variation-stock-status.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.wsc-variation-stock-status.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

/* ========== Metas de Progreso ========== */
.wsc-progress-goals {
    margin: 0 0 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, #F0F4FF 0%, #F9F5FF 100%);
    border-radius: 12px;
    border: 1px solid #DDD6FE;
    box-shadow: 0 1px 3px rgba(139, 92, 246, 0.05);
}

.wsc-items-wrapper {
    flex: 1;
}

/* Mensaje principal */
.wsc-goal-main-message {
    text-align: center;
    font-size: 13px;
    line-height: 1.4;
    color: var(--wsc-text-dark);
    margin-bottom: 20px;
}

.wsc-goal-main-message strong {
    color: var(--wsc-primary);
    font-weight: 700;
}

/* Contenedor de la barra */
.wsc-goal-bar-container {
    position: relative;
    padding-top: 35px;
    padding-bottom: 25px;
}

/* Barra de progreso */
.wsc-goal-bar {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wsc-goal-bar-fill {
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, #534dfa 0%, #534dfa 100%);
}

/* Iconos de las metas */
.wsc-goal-icons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.wsc-goal-icon-wrapper {
position: absolute;
    top: -6px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    transition: all 0.3s ease;
}

.wsc-goal-icon-circle {
    width: 32px;
    height: 32px;
    background: white;
    border: 2px solid #E0E0E0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.wsc-goal-icon-circle svg {
    width: 16px;
    height: 16px;
    color: #9E9E9E;
    transition: color 0.3s ease;
}

.wsc-goal-icon-wrapper.achieved .wsc-goal-icon-circle {
    background: #534dfa;
    border-color: #534dfa;
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

.wsc-goal-icon-wrapper.achieved .wsc-goal-icon-circle svg {
    color: white;
}

.wsc-goal-label {
    font-size: 11px;
    font-weight: 600;
    color: #757575;
    white-space: nowrap;
    text-align: center;
    max-width: 80px;
    line-height: 1.2;
}

.wsc-goal-icon-wrapper.achieved .wsc-goal-label {
    color: #534dfa;
}

/* Responsive */
@media (max-width: 480px) {
    .wsc-goal-main-message {
        font-size: 12px;
    }
    
    .wsc-goal-label {
        font-size: 10px;
        max-width: 70px;
    }
    
    .wsc-goal-icon-circle {
        width: 28px;
        height: 28px;
    }
    
    .wsc-goal-icon-circle svg {
        width: 14px;
        height: 14px;
    }
}

/* Animaciones */
.wsc-goal-icon-wrapper.achieved .wsc-goal-icon-circle {
    animation: wsc-goal-bounce 0.5s ease;
}

@keyframes wsc-goal-bounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1.1);
    }
}

.wsc-goal-bar-fill {
    animation: wsc-bar-grow 0.6s ease;
}

@keyframes wsc-bar-grow {
    from {
        width: 0;
    }
}


.wsc-applied-coupon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px;
    color:white;
    border-radius: 6px;
    margin-bottom: 8px;
}


.wsc-coupon-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: white;
    font-weight: normal;
}

.wsc-coupon-info strong {
    font-weight: 600;
}

.wsc-coupon-code {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--wsc-primary);
}

.wsc-remove-coupon {
    background: transparent;
    border: none;
    color: #999;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}


.wsc-coupon-discount {
    font-size: 14px;
    color: white;
}

/* ========== Mobile Height Fixes ========== */
@media (max-width: 768px) {
    /* Asegurar altura completa en móvil */
    .wsc-sidebar,
    .wsc-overlay {
        height: 100vh;
        height: 100dvh;
        min-height: -webkit-fill-available;
    }
    
    /* Scroll suave en iOS */
    .wsc-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* Fix específico para Safari iOS */
@supports (-webkit-touch-callout: none) {
    .wsc-sidebar,
    .wsc-overlay {
        height: -webkit-fill-available;
    }
}