/* ═══════════════════════════════════════════════
   ECOLOGIC — 3D Product Carousel (CSS Transform)
   Replaces WebGL globe — works on file:// protocol
   ═══════════════════════════════════════════════ */

/* ── Carousel Container ── */
.product-carousel-section {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 520px;
    background: radial-gradient(ellipse at 50% 50%, var(--color-navy-dark) 0%, var(--color-navy-deeper) 65%, #050806 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    cursor: grab;
    user-select: none;
}
.product-carousel-section:active { cursor: grabbing; }

/* ── 3D Ring ── */
.carousel-ring {
    position: relative;
    width: 300px;
    height: 300px;
    transform-style: preserve-3d;
    transition: transform 0.08s linear;
}

/* ── Individual Carousel Items ── */
.carousel-item {
    position: absolute;
    width: 240px;
    height: 260px;
    left: 50%;
    top: 50%;
    margin-left: -120px;
    margin-top: -130px;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(20, 25, 45, 0.7);
    border: 1.5px solid rgba(167, 199, 231, 0.12);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: box-shadow 0.4s ease, border-color 0.4s ease, transform 0.3s ease;
    backface-visibility: hidden;
}
.carousel-item:hover {
    border-color: rgba(167, 199, 231, 0.35);
    box-shadow:
        0 16px 56px rgba(167, 199, 231, 0.12),
        0 0 0 1px rgba(167, 199, 231, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    border-radius: 20px;
}

.carousel-item-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent 0%, rgba(6, 10, 20, 0.9) 100%);
    border-radius: 0 0 20px 20px;
}
.carousel-item-label h3 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--color-white);
    margin: 0;
    line-height: 1.3;
}

/* ── Carousel Side Info ── */
.carousel-info-left,
.carousel-info-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    pointer-events: none;
    max-width: 220px;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.carousel-info-left.active,
.carousel-info-right.active {
    opacity: 1;
}

.carousel-info-left {
    left: 5%;
}
.carousel-info-right {
    right: 5%;
    text-align: right;
}

.carousel-active-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    color: var(--color-white);
    line-height: 1.15;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.carousel-active-desc {
    font-family: var(--font-body);
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
    margin-top: 8px;
}

/* ── Carousel Action ── */
.carousel-cta {
    position: absolute;
    bottom: 3.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 32px;
    background: rgba(27, 38, 79, 0.8);
    border: 1px solid rgba(167, 199, 231, 0.15);
    border-radius: 100px;
    color: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}
.carousel-cta.active {
    opacity: 1;
    pointer-events: auto;
}
.carousel-cta:hover {
    background: var(--color-sky);
    color: var(--color-navy);
    border-color: var(--color-sky);
    box-shadow: 0 0 30px rgba(167,199,231,0.3);
}

/* ── Hint ── */
.carousel-hint {
    position: absolute;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-body);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    z-index: 3;
    animation: carouselPulse 2.5s ease-in-out infinite;
}
@keyframes carouselPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

/* ── Product Modal ── */
.product-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(6, 10, 20, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.product-modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.product-modal {
    background: linear-gradient(145deg, #141A2E 0%, #0E1322 100%);
    border: 1px solid rgba(167,199,231,0.08);
    border-radius: 24px;
    max-width: 900px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    box-shadow: 0 40px 100px rgba(0,0,0,0.6);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-modal-backdrop.open .product-modal {
    transform: scale(1) translateY(0);
}

.product-modal-image {
    position: relative;
    background: #0D0F18;
    border-radius: 24px 0 0 24px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
}
.product-modal-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 35px), calc(100% - 35px) 100%, 0 100%);
}
.product-modal-image .modal-logo {
    position: absolute;
    bottom: 14px; right: 14px;
    width: 32px; height: 32px;
    opacity: 0.6;
}

.product-modal-info {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}
.product-modal-info .modal-tag {
    font-family: var(--font-body);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-sky);
}
.product-modal-info h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 2.2vw, 1.9rem);
    color: var(--color-white);
    line-height: 1.2;
}
.product-modal-info .modal-desc {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    line-height: 1.6;
}

.modal-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.modal-spec-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(167,199,231,0.06);
    border-radius: 12px;
    padding: 12px;
}
.modal-spec-item .spec-label {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(167,199,231,0.6);
    margin-bottom: 3px;
}
.modal-spec-item .spec-value {
    font-size: 0.85rem;
    color: var(--color-white);
    font-weight: 500;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap; /* Fixes button squishing */
    gap: 10px;
    margin-top: 0.5rem;
}
.modal-btn-buy {
    flex: 1;
    padding: 12px 20px;
    background: var(--color-sky);
    color: var(--color-navy);
    border: none;
    border-radius: 100px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.modal-btn-buy:hover {
    background: var(--color-white);
    box-shadow: 0 0 20px rgba(167,199,231,0.3);
}
.modal-btn-cart {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    color: var(--color-sky);
    border: 1px solid rgba(167,199,231,0.2);
    border-radius: 100px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.modal-btn-cart:hover {
    border-color: var(--color-sky);
    background: rgba(167,199,231,0.05);
}

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 38px; height: 38px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 50%;
    color: var(--color-white);
    font-size: 1.1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 10;
    transition: all 0.3s ease;
}
.modal-close:hover { background: rgba(167,199,231,0.15); }

/* ── Cookie Consent ── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    z-index: 9980;
    background: linear-gradient(180deg, rgba(11,17,32,0.95) 0%, rgba(6,10,20,0.98) 100%);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(167,199,231,0.08);
    padding: 20px 0;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.cookie-text {
    flex: 1;
    min-width: 280px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    line-height: 1.5;
}
.cookie-text a {
    color: var(--color-sky);
    text-decoration: underline;
}
.cookie-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.cookie-btn-accept {
    padding: 10px 24px;
    background: var(--color-sky);
    color: var(--color-navy);
    border: none;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}
.cookie-btn-accept:hover { background: var(--color-white); }
.cookie-btn-customize {
    padding: 10px 24px;
    background: transparent;
    color: var(--color-sky);
    border: 1px solid rgba(167,199,231,0.2);
    border-radius: 100px;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}
.cookie-btn-customize:hover { border-color: var(--color-sky); }

/* ── Cart Drawer ── */
.cart-drawer-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(6, 10, 20, 0.6);
    z-index: 9985;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.cart-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
    position: fixed;
    top: 0; right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(180deg, #111B3A 0%, #0B1120 100%);
    border-left: 1px solid rgba(167,199,231,0.08);
    z-index: 9986;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(167,199,231,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cart-header h3 {
    font-family: var(--font-heading);
    color: var(--color-white);
    font-size: 1.2rem;
}
.cart-close {
    width: 32px; height: 32px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    color: var(--color-white);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.3s;
}
.cart-close:hover { background: rgba(167,199,231,0.1); }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}
.cart-empty {
    text-align: center;
    padding: 40px 0;
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
}

.cart-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cart-item img {
    width: 64px; height: 64px;
    border-radius: 10px;
    object-fit: cover;
}
.cart-item-info { flex: 1; }
.cart-item-info h4 {
    font-size: 0.85rem;
    color: var(--color-white);
    margin: 0 0 4px 0;
}
.cart-item-info .cart-item-price {
    font-size: 0.75rem;
    color: var(--color-sky);
}
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.cart-item-qty button {
    width: 26px; height: 26px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: var(--color-white);
    cursor: pointer;
    font-size: 0.8rem;
}
.cart-item-qty span {
    font-size: 0.85rem;
    color: var(--color-white);
    min-width: 20px;
    text-align: center;
}

.cart-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(167,199,231,0.08);
}
.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 1rem;
    color: var(--color-white);
    font-weight: 600;
}
.cart-checkout-btn {
    width: 100%;
    padding: 14px;
    background: var(--color-sky);
    color: var(--color-navy);
    border: none;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}
.cart-checkout-btn:hover {
    background: var(--color-white);
    box-shadow: 0 0 20px rgba(167,199,231,0.3);
}

/* Nav cart icon */
.nav-cart {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(167,199,231,0.08);
    border: 1px solid rgba(167,199,231,0.12);
    border-radius: 100px;
    color: var(--color-white);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 8px;
}
.nav-cart:hover { background: rgba(167,199,231,0.15); }
.nav-cart-count {
    background: var(--color-sky);
    color: var(--color-navy);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 100px;
    min-width: 18px;
    text-align: center;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .product-carousel-section { height: 55vh; min-height: 380px; }
    .carousel-item { width: 160px; height: 160px; margin-left: -80px; margin-top: -80px; }
    .carousel-info-left, .carousel-info-right { display: none; }
    .carousel-cta { bottom: 2rem; padding: 12px 24px; font-size: 0.8rem; }
    .product-modal { grid-template-columns: 1fr; }
    .product-modal-image { border-radius: 24px 24px 0 0; min-height: 220px; }
    .product-modal-info { padding: 1.5rem; }
    .modal-actions { flex-direction: column; }
    .cart-drawer { width: 100vw; }
}
