/* ========================================
   Product Box - 3D Card Effect
   ======================================== */

.product-box-wrapper {
    perspective: 1200px;
}

.product-box {
    position: relative;
    transform: rotateX(0.5deg);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    box-shadow:
        0 2px 4px -1px rgba(0, 0, 0, 0.2),
        0 10px 24px -8px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.product-box:hover {
    transform: rotateX(0.3deg) rotateY(-0.3deg) translateY(-1px);
    box-shadow:
        0 4px 8px -2px rgba(0, 0, 0, 0.25),
        0 16px 32px -10px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.product-box-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, transparent 40%, transparent 60%, rgba(255, 255, 255, 0.01) 100%);
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.product-box-shelf {
    height: 4px;
    margin: 0 12px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.15), transparent);
    border-radius: 0 0 50% 50%;
}

/* Product icon glow */
.product-icon-glow {
    position: absolute;
    inset: -6px;
    border-radius: 16px;
    filter: blur(12px);
    opacity: 0.3;
    z-index: 0;
    transition: opacity 0.3s ease;
}

.product-icon-glow--red {
    background: radial-gradient(circle, rgba(248, 113, 113, 0.6), transparent 70%);
}

.product-icon-glow--blue {
    background: radial-gradient(circle, rgba(96, 165, 250, 0.6), transparent 70%);
}

.product-box:hover .product-icon-glow {
    opacity: 0.45;
}

/* ========================================
   Spec Pills
   ======================================== */

.spec-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 9999px;
    font-size: 12px;
    line-height: 1.2;
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: default;
}

.spec-pill i {
    font-size: 11px;
}

.spec-pill:hover {
    border-color: rgba(107, 114, 128, 0.7);
    background: rgba(17, 24, 39, 0.9);
}

.spec-pill--accent {
    border-color: rgba(248, 113, 113, 0.25);
    background: rgba(248, 113, 113, 0.06);
}

.spec-pill--accent:hover {
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.1);
}

/* ========================================
   Billing Period Radio Cards (sidebar)
   ======================================== */

.billing-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid #374151;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.billing-radio:hover {
    border-color: #4b5563;
    background: rgba(255, 255, 255, 0.02);
}

.billing-radio.active {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(248, 113, 113, 0.06);
}

.billing-radio.active:hover {
    background: rgba(248, 113, 113, 0.08);
}

.billing-radio.active .billing-radio-label {
    color: #f3f4f6;
}

.billing-radio-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #4b5563;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s ease;
}

.billing-radio.active .billing-radio-dot {
    border-color: #f87171;
}

.billing-radio.active .billing-radio-dot::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f87171;
}

.billing-radio-price {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #d1d5db;
    white-space: nowrap;
}

.billing-radio.active .billing-radio-price {
    color: #ffffff;
}

.billing-radio-currency,
.billing-radio-price > span {
    font-size: 10px !important;
    font-weight: 600;
    margin-left: 1px;
}

.billing-discount-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.3;
    pointer-events: none;
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
    flex-shrink: 0;
}

.billing-discount-tag--best {
    background: rgba(52, 211, 153, 0.25);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.4);
}

/* ========================================
   Upsell Banner
   ======================================== */

.upsell-banner {
    position: relative;
}

/* ========================================
   CTA Button
   ======================================== */

.cta-btn {
    position: relative;
    overflow: hidden;
}

.cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.cta-btn:hover::before {
    left: 100%;
}

.cta-arrow {
    transition: transform 0.3s ease;
    font-size: 0.85em;
}

.cta-btn:hover .cta-arrow {
    transform: translateX(3px);
}

/* ========================================
   Animations
   ======================================== */

@keyframes arrow-slide {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(8px);
    }
}

.animate-arrow-slide {
    animation: arrow-slide 1.5s ease-in-out infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* ========================================
   Tooltips (pure CSS, positioned above parent)
   ======================================== */

.tooltip-box {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #e5e7eb;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #374151;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 9999;
    pointer-events: none;
}

.tooltip-arrow {
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: #1f2937;
    border-left: 1px solid #374151;
    border-bottom: 1px solid #374151;
    transform: translateX(-50%) rotate(45deg);
}

.group:hover > .tooltip-box {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   Addon Tooltips
   ======================================== */

.addon-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #e5e7eb;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #374151;
    font-size: 11px;
    line-height: 1.4;
    white-space: normal;
    max-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 9999;
    pointer-events: none;
}

.addon-tooltip-arrow {
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: #1f2937;
    border-left: 1px solid #374151;
    border-bottom: 1px solid #374151;
    transform: translateX(-50%) rotate(45deg);
}

.addon-item:hover .addon-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   Product Image
   ======================================== */

.product-image {
    transition: transform 0.2s ease-in-out;
}

.product-image:hover {
    transform: scale(1.05);
}

.product-image svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ========================================
   Price Transition
   ======================================== */

.price-transition {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.price-transition.updating {
    transform: scale(1.1);
    color: #f87171;
}

/* ========================================
   Savings Badge
   ======================================== */

.savings-badge {
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
}

/* ========================================
   Mobile Sticky Bar
   ======================================== */

.mobile-sticky-bar {
    animation: slideUp 0.3s ease;
}

@media (max-width: 768px) {
    .mobile-sticky-spacer {
        height: 150px;
    }
}

/* ========================================
   Toast Notification
   ======================================== */

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 4.7s;
    pointer-events: auto;
}

/* ========================================
   Toggle Switch
   ======================================== */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #374151;
    border: 1.5px solid #4b5563;
    border-radius: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider:before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 2.5px;
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.25) 0%, rgba(239, 68, 68, 0.15) 100%);
    border-color: rgba(248, 113, 113, 0.6);
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.1), inset 0 1px 3px rgba(248, 113, 113, 0.2);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.4), 0 0 0 2px rgba(248, 113, 113, 0.2);
}

.toggle-switch:hover .toggle-slider {
    border-color: #6b7280;
}

.toggle-switch:hover input:checked + .toggle-slider {
    border-color: rgba(248, 113, 113, 0.8);
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.3) 0%, rgba(239, 68, 68, 0.2) 100%);
}

/* ========================================
   Light Theme Overrides
   ======================================== */

.light .product-box {
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 20px 40px -10px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.04) inset;
}

.light .product-box:hover {
    box-shadow:
        0 8px 12px -2px rgba(0, 0, 0, 0.1),
        0 30px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.06) inset;
}

.light .product-box-shine {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 40%, transparent 60%, rgba(255, 255, 255, 0.1) 100%);
}

.light .product-box-shelf {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.06), transparent);
}

.light .product-icon-glow--red {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.3), transparent 70%);
}

.light .product-icon-glow--blue {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3), transparent 70%);
}

.light .spec-pill {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.light .spec-pill:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.light .spec-pill .text-white { color: #1e293b !important; }
.light .spec-pill .text-gray-400 { color: #64748b !important; }

.light .spec-pill--accent {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.04);
}

.light .spec-pill--accent:hover {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.07);
}

.light .spec-pill--accent .text-red-300 { color: #ef4444 !important; }
.light .spec-pill--accent .text-red-400 { color: #dc2626 !important; }

.light .billing-radio {
    border-color: #d1d5db;
    background: transparent;
}

.light .billing-radio:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.light .billing-radio.active {
    border-color: rgba(220, 38, 38, 0.4);
    background: rgba(220, 38, 38, 0.04);
}

.light .billing-radio .billing-radio-label {
    color: #64748b;
}

.light .billing-radio.active .billing-radio-label {
    color: #1e293b;
}

.light .billing-radio-dot {
    border-color: #cbd5e1;
}

.light .billing-radio.active .billing-radio-dot {
    border-color: #dc2626;
}

.light .billing-radio.active .billing-radio-dot::after {
    background: #dc2626;
}

.light .billing-radio-price {
    color: #475569;
}

.light .billing-radio.active .billing-radio-price {
    color: #1e293b;
}

.light .billing-discount-tag {
    background: rgba(5, 150, 105, 0.12);
    color: #047857;
    border-color: rgba(5, 150, 105, 0.25);
}

.light .billing-discount-tag--best {
    background: rgba(5, 150, 105, 0.18);
    color: #047857;
    border-color: rgba(5, 150, 105, 0.35);
}

.light .toggle-slider {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.light .toggle-slider:before {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.light .cta-btn::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

/* Basket cards and nested elements distinction */
.light .product-box {
    background: #ffffff !important;
    border-color: #d1d5db !important;
}

.light .upsell-banner {
    background: #ffffff !important;
    border-color: #d1d5db !important;
}

.light .upsell-banner .border-gray-700\/50 {
    border-color: #e2e8f0 !important;
}
