/* assets/css/amazon-style.css */

/* --- Top Header Navigation --- */
.amazon-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    /* Premium dark background */
    border-bottom: 1px solid var(--border-primary);
    z-index: 9999;
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    transition: background 0.3s ease-in-out;
}

/* Logo Alignment */
.amazon-logo {
    display: flex;
    align-items: center;
}

.amazon-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: var(--logo-filter);
}

/* Central Search Bar */
.amazon-search {
    flex: 1;
    display: flex;
    max-width: 650px;
    align-items: center;
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.amazon-search:focus-within {
    border-color: var(--border-focus);
}

.amazon-search input {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

.amazon-search button {
    background: var(--text-primary);
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    color: var(--text-contrast);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.amazon-search button:hover {
    opacity: 0.9;
}

/* Account & Cart Options */
.amazon-nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
    color: var(--text-primary);
}

.nav-link-item {
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    transition: opacity 0.2s;
}

.nav-link-item:hover {
    opacity: 0.8;
}

.nav-link-item .subtext {
    font-weight: 600;
    font-size: 0.95rem;
}

/* --- Secondary Navigation Bar --- */
.amazon-subnav {
    position: fixed;
    top: 60px;
    /* immediately below main header */
    left: 0;
    width: 100%;
    background: var(--bg-quaternary);
    padding: 8px 40px;
    border-bottom: 1px solid var(--border-primary);
    z-index: 9998;
    display: flex;
    gap: 20px;
    align-items: center;
}

.amazon-subnav a {
    text-decoration: none;
    color: #aaaaaa;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.amazon-subnav a:hover {
    color: #ffffff;
}

/* --- Sidebar Filters Redesign --- */
.filter-star-link {
    text-decoration: none;
    color: #dddddd;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 0;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.filter-star-link:hover {
    color: #ffffff;
}

.star-icon {
    color: #ffb400;
    /* gold/orange standard stars */
    font-size: 1rem;
}

.star-icon.empty {
    color: #444444;
}

/* --- Product Cards Updates --- */
.product-review {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    margin-top: -10px;
    /* Pull it slightly above the title spacing */
}

/* Amazon Fractional Price display */
.amazon-price {
    display: inline-flex;
    align-items: flex-start;
    font-weight: 700;
    font-size: 1.5rem;
    color: #ffffff;
}

.amazon-price .currency {
    font-size: 0.8rem;
    margin-top: 4px;
    margin-right: 2px;
}

.amazon-price .cents {
    font-size: 0.85rem;
    margin-top: 2px;
}

/* Adjust Main Scroll Area to fit top fix header */
.wrap-content {
    padding-top: 100px;
    /* combined height of both header lines approx */
}

/* --- Carousel Overlays & adjustments --- */
.shop-hero-carousel {
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.shop-hero-carousel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 20%, var(--bg-primary) 100%);
    /* Matched theme background */
    z-index: 5;
    pointer-events: none;
}

.carousel-item {
    position: relative;
}

.carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: linear-gradient(to right, rgba(0, 0, 0, 0.03) 10%, rgba(0, 0, 0, 0.01) 100%); */
    z-index: 1;
}

.carousel-caption {
    z-index: 10;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    width: 90%;
    top: 100px !important;
    bottom: auto !important;
    text-align: center !important;
}

.carousel-caption p {
    margin: 0 auto 1.5rem auto !important;
    max-width: 537px;
    text-align: center !important;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .carousel-caption {
        top: 20px;
    }

    .carousel-caption h1 {
        font-size: 1.8rem !important;
    }

    .carousel-caption p {
        font-size: 0.85rem !important;
    }
}

/* --- Homepage Card Widgets & inner 4-grids --- */
.amazon-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.amazon-home-card {
    background: var(--bg-tertiary);
    /* Matching theme dark card */
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.amazon-home-card h4 {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 15px;
    font-family: 'Outfit', sans-serif;
}

.grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.sub-grid-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.product-img-wrapper {
    position: relative;
    background: var(--image-bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 1 / 1 !important;
    width: 100%;
}

/* Ensure image is above watermark and scaled correctly */
.product-img-aspect {
    width: 100% !important;
    height: 100%;
    object-fit: contain !important;
    z-index: 2;
    display: block;
}

/* Apply relative positioning to primary images but allow secondary to be absolute */
.product-img-aspect:not(.img-secondary) {
    position: relative;
}
.product-img-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 85%;
    background: url('../img/branding/playvibe-svg.svg') no-repeat center;
    background-size: contain;
    opacity: var(--watermark-opacity);
    z-index: 1;
    pointer-events: none;
}

.sub-grid-item .product-img-wrapper {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    margin-bottom: 8px;
}

.sub-grid-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.2s;
    position: relative;
    /* Ensure it stays above watermark */
    z-index: 2;
}

.sub-grid-item:hover img {
    transform: scale(1.03);
}

.sub-grid-item span {
    color: #cccccc;
    font-size: 0.75rem;
    margin-top: 4px;
    display: block;
}

.amazon-home-card .card-footer-link {
    text-decoration: none;
    color: #0088ff;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: auto;
}

/* --- Horizontal Shelves --- */
.horizontal-shelf {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 40px;
    position: relative;
    overflow: visible;
}

.horizontal-shelf h4 {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.shelf-scroller {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    scroll-behavior: smooth;
}

.shelf-scroller::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for slider look */
}

/* Scroll Arrows */
.shelf-arrow {
    position: absolute;
    top: calc(50% + 15px);
    /* Centered considering title */
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #444444;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    opacity: 0.6;
}

.shelf-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    opacity: 1;
}

.shelf-arrow.prev-arrow {
    left: 5px;
}

.shelf-arrow.next-arrow {
    right: 5px;
}

.shelf-arrow span {
    width: 20px;
    height: 20px;
}

.shelf-item {
    flex: 0 0 160px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.shelf-item .product-img-wrapper {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
    background: var(--image-bg-gradient);
}

.shelf-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    /* Ensure it stays above watermark */
    z-index: 2;
}

.shelf-item .price {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .amazon-header {
        padding: 10px 20px;
        gap: 15px;
    }

    .amazon-search {
        max-width: 100%;
        order: 3;
        /* Push down on mobile if needed */
        flex-basis: 100%;
    }

    .amazon-header {
        flex-wrap: wrap;
    }

    .wrap-content {
        padding-top: 140px;
        /* mobile height adjust */
    }
}

/* --- Fixes for Preloader & Cursor Z-index Stacking --- */
/* --- Selective Overlap (Homepage only) --- */
.shop-hero-carousel + .shop-section {
    position: relative;
    z-index: 10;
    margin-top: -120px;
    /* Final adjusted overlap for homepage */
}

.pv-pageload-container {
    z-index: 99999 !important;
    /* Higher than .amazon-header (9999) */
}

.node,
.cursor {
    z-index: 100000 !important;
    /* Highest to float above header bar */
}

/* --- Single Product Detail View Layout --- */
.product-detail-view {
    background: #0d0d0d;
    color: #ffffff;
    margin-top: 20px;
}

/* 1. Left: Gallery column */
.product-gallery {
    position: sticky;
    top: 110px;
    /* offset for header + subnav sticky heights */
}

.main-image-wrap {
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    background: var(--image-bg-gradient);
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-image-wrap img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.thumbnail-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.thumb-item {
    flex: 0 0 60px;
    height: 60px;
    border: 1px solid #333333;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    background: #1a1a1a;
    transition: border-color 0.2s;
}

.thumb-item:hover,
.thumb-item.active {
    border-color: #ffb400;
    /* Gold standard Amazon highlight look */
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 2. Center: Info Details */
.product-info-wrap .brand-link {
    color: #0088ff;
    font-size: 0.9rem;
    text-decoration: none;
}

.product-info-wrap h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 5px;
    margin-bottom: 10px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.rating-stars {
    color: #ffb400;
}

.reviews-count {
    font-size: 0.85rem;
    color: #0088ff;
    text-decoration: none;
}

.product-info-wrap .amazon-price {
    font-size: 2rem;
    margin-bottom: 10px;
}

.section-divider {
    height: 1px;
    background: #222222;
    margin: 15px 0;
}

.variant-section h6 {
    font-size: 0.9rem;
    color: #aaaaaa;
    margin-bottom: 8px;
}

.variant-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.option-btn {
    background: #1a1a1a;
    border: 1px solid #333333;
    color: #dddddd;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover,
.option-btn.active {
    background: #252525;
    border-color: #ffb400;
    color: #ffffff;
}

.bullet-list {
    padding-left: 20px;
    margin-top: 10px;
}

.bullet-list li {
    font-size: 0.9rem;
    color: #cccccc;
    margin-bottom: 6px;
    position: relative;
    list-style-type: disc;
}

/* 3. Right: Buy Box Card */
.buy-box-card {
    background: #141414;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 110px;
}

.buy-box-card .amazon-price {
    font-size: 1.5rem;
}

.delivery-info {
    font-size: 0.85rem;
    color: #cccccc;
    margin-bottom: 12px;
}

.delivery-info .highlight {
    color: #ffffff;
    font-weight: 600;
}

.stock-status {
    color: #00b0ff;
    /* positive blue standard Amazon style for pre-order etc or gold green */
    font-weight: 600;
    margin-bottom: 15px;
}

.buy-box-card select {
    background: #1a1a1a;
    border: 1px solid #333333;
    color: #ffffff;
    border-radius: 4px;
    padding: 5px;
    width: 80px;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.buy-btn {
    display: block;
    width: 100%;
    padding: 10px;
    border-radius: 20px;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-to-cart {
    background: #ffd814;
    color: #000000;
}

.btn-add-to-cart:hover {
    background: #f7ca00;
}

.btn-buy-now {
    background: #ffa41c;
    color: #000000;
}

.btn-buy-now:hover {
    background: #f28c00;
}

.secure-transaction {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #aaaaaa;
    margin-top: 15px;
}