/**
 * Décantation Aromatica - Frontend Styles
 * Brand Color: #d4a65a (Gold)
 */

:root {
    --dec-primary: #d4a65a;
    --dec-primary-dark: #b8903e;
    --dec-primary-light: #e8c88a;
    --dec-success: #10b981;
    --dec-success-light: #d1fae5;
    --dec-warning: #f59e0b;
    --dec-warning-light: #fef3c7;
    --dec-danger: #ef4444;
    --dec-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --dec-radius: 8px;
    --dec-radius-sm: 5px;
}

/* =============================================
   WOODMART TOOLBAR FIX
   ============================================= */

.shop-loop-head {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.shop-loop-head .wd-shop-tools:first-child {
    flex: 0 0 auto;
    order: 1 !important;
}

.shop-loop-head .wd-shop-tools:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    order: 2 !important;
}

/* =============================================
   PREMIUM TIMELINE BANNER
   ============================================= */
.dec-premium-banner {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    width: 100%;
    clear: both;
}

/* Hidden by default if printed in footer to prevent flicker */
.dec-banner-footer-fallback {
    display: none !important;
}

.dec-banner-header {
    text-align: center;
    margin-bottom: 24px;
}

.dec-banner-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.dec-banner-status {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
}

.dec-banner-status strong {
    color: var(--dec-primary-dark, #0f172a);
}

.dec-timeline-wrapper {
    position: relative;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-behavior: smooth; /* For smooth JS scrolling */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.dec-timeline-wrapper::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.dec-timeline-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: max-content;
    position: relative;
    padding: 0 20px;
    gap: 40px; /* Space between tiers */
}

/* Gray background line */
.dec-timeline-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    height: 4px;
    background: #e2e8f0;
    transform: translateY(-50%);
    z-index: 1;
    border-radius: 4px;
}

/* Gold active line */
.timeline-progress-bar {
    position: absolute;
    top: 50%;
    left: 40px;
    height: 4px;
    background: #d4a65a;
    transform: translateY(-50%);
    z-index: 2;
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.dec-tier-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
    gap: 12px;
    min-width: 80px;
}

.dec-tier-value {
    font-size: 14px;
    font-weight: 800;
    color: #94a3b8;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.dec-tier-dot {
    width: 20px;
    height: 20px;
    background: #e2e8f0;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 0 0 1px #e2e8f0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dec-tier-dot .tier-check {
    color: #ffffff;
    font-size: 10px;
}

.dec-tier-qty {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

/* State: Active (Completed) */
.dec-tier-item.active .dec-tier-value {
    color: #ffffff;
    background: #0f172a;
    border-color: #0f172a;
}
.dec-tier-item.active .dec-tier-dot {
    background: #0f172a;
    box-shadow: 0 0 0 1px #0f172a;
}

/* State: Current (Just reached) */
.dec-tier-item.current .dec-tier-value {
    color: #ffffff;
    background: #d4a65a;
    border-color: #d4a65a;
    box-shadow: 0 4px 12px rgba(212, 166, 90, 0.3);
}
.dec-tier-item.current .dec-tier-dot {
    background: #d4a65a;
    box-shadow: 0 0 0 1px #d4a65a, 0 0 0 6px rgba(212, 166, 90, 0.2);
    animation: pulse-gold-small 2s infinite;
}
.dec-tier-item.current .dec-tier-qty {
    color: #d4a65a;
}

@keyframes pulse-gold-small {
    0% { box-shadow: 0 0 0 1px #d4a65a, 0 0 0 0 rgba(212, 166, 90, 0.4); }
    70% { box-shadow: 0 0 0 1px #d4a65a, 0 0 0 8px rgba(212, 166, 90, 0); }
    100% { box-shadow: 0 0 0 1px #d4a65a, 0 0 0 0 rgba(212, 166, 90, 0); }
}

@media (max-width: 768px) {
    .dec-premium-banner {
        padding: 16px;
        margin-bottom: 20px;
    }
    .dec-banner-title {
        font-size: 16px;
    }
    .dec-banner-status {
        font-size: 13px;
        padding: 6px 12px;
    }
    .dec-timeline-track {
        gap: 30px;
    }
}

/* =============================================
   FLOATING CART
   ============================================= */
.decantation-floating-cart {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 9999;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 10px 12px 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    pointer-events: none;
    max-width: 90vw;
}

.decantation-floating-cart.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.decantation-floating-cart.updating {
    opacity: 0.7;
    pointer-events: none;
}

.decantation-floating-cart.updating .floating-cart-inner {
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.98);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.floating-cart-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.floating-cart-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-count {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}

.count-number {
    font-size: 18px;
    font-weight: 900;
    color: #1f2937;
}

.count-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    font-weight: 600;
}

.discount-badge {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
    letter-spacing: 0.3px;
}

.floating-cart-total {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
    padding: 0 10px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    /* Prevent wrapping for large numbers */
}

.total-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
}

.total-amount {
    font-size: 15px;
    /* Slightly smaller to fit large numbers */
    font-weight: 800;
    color: var(--dec-primary-dark);
}

.floating-cart-button {
    background: var(--dec-primary) !important;
    /* Gold default */
    color: #1f2937 !important;
    /* Dark text */
    /* Dark text */
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.3s ease;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(212, 166, 90, 0.3);
}

.floating-cart-button:hover {
    background: #1f2937 !important;
    color: #ffffff !important;
    transform: scale(1.05);
}

/* =============================================
   DECANTATION BUTTON - INHERIT WOODMART NATIVE
   ============================================= */
/* No custom radius or size overrides - let WoodMart handle it */

/* Button hover - subtle lift only, rest handled by theme */
.decantation-add-to-cart:hover {
    transform: translateY(-2px);
}

/* RESPONSIVE */
@media (max-width: 768px) {

    /* Narrower mobile popup */
    .decantation-floating-cart {
        bottom: 20px;
        padding: 6px 10px 6px 15px;
        width: 95% !important;
        box-sizing: border-box;
    }

    .floating-cart-inner {
        gap: 5px;
        justify-content: space-between;
        width: 100%;
    }

    .floating-cart-info {
        gap: 8px;
    }

    .count-number {
        font-size: 14px;
    }

    .total-amount {
        font-size: 14px;
    }

    .count-label,
    .total-label {
        display: none !important;
        /* Hide labels to save space and fix alignment */
    }

    .floating-cart-button {
        padding: 8px 12px;
        font-size: 10px;
        min-width: 90px;
        text-align: center;
        border-radius: 12px;
    }

    .discount-badge {
        padding: 2px 5px;
        font-size: 9px;
        white-space: nowrap;
        /* Prevent breaking */
        align-self: center;
    }
}

/* =============================================
   SINGLE PRODUCT - DECANTATION INFO BOX (REDESIGN)
   ============================================= */

.decantation-single-info {
    margin: 25px 0;
    padding: 0;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.decantation-single-info:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    border-color: #d4a65a;
}

.decantation-single-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-bottom: 1px solid #d1fae5;
}

.decantation-single-icon {
    font-size: 18px;
    line-height: 1;
}

.decantation-single-title {
    font-size: 13px;
    font-weight: 800;
    color: #065f46;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* =============================================
   LOADING SPINNER
   ============================================= */
.decantation-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: decantation-spin 0.8s linear infinite;
}

@keyframes decantation-spin {
    to {
        transform: rotate(360deg);
    }
}

.decantation-add-to-cart.loading {
    cursor: not-allowed;
    opacity: 0.8;
}

.decantation-add-to-cart.added {
    background: #10b981 !important;
    border-color: #10b981 !important;
}

.decantation-add-to-cart[disabled] {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.decantation-single-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.decantation-single-price-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 10px 0;
}

.decantation-single-size {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    background: #10b981;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    border-radius: 6px;
    letter-spacing: 0.5px;
    border: none;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.decantation-single-price {
    font-size: 30px;
    font-weight: 700;
    color: #d4a65a;
    line-height: 1;
}

.decantation-single-price .woocommerce-Price-amount {
    font-weight: inherit;
}

.decantation-single-desc {
    font-size: 14px;
    color: #666666;
    margin: 0;
    line-height: 1.6;
}

.decantation-single-desc .woocommerce-Price-amount {
    font-weight: 700;
    color: #333333;
}

.decantation-single-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: #d4a65a;
    color: #111827 !important;
    font-size: 13px;
    font-weight: 800;
    border-radius: 6px;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
}

.decantation-single-btn:hover {
    background: #b8903e;
    color: #111827 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 166, 90, 0.3);
}

.decantation-single-oos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: #fdf2f2;
    color: #ef4444;
    font-size: 13px;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .decantation-single-info {
        margin: 20px 0;
    }
    
    .decantation-single-header {
        padding: 12px 15px;
    }
    
    .decantation-single-body {
        padding: 15px;
        gap: 12px;
    }
    
    .decantation-single-btn {
        padding: 12px 20px;
        font-size: 12px;
    }
    
    .decantation-single-price {
        font-size: 25px;
    }
}