/* Amazon Storefront Frontend Styles */

/* ── Full-width breakout ─────────────────────────────── */
.azss-storefront-wrapper {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow-x: hidden;
}

/* ── Shared Design Tokens ──────────────────────────────── */
.azss-storefront,
.azss-single-product {
    --azss-gap: 24px;
    --azss-radius: 14px;
    --azss-radius-sm: 10px;
    --azss-radius-pill: 50px;
    --azss-amazon-orange: #f5a623;
    --azss-amazon-orange-hover: #e8991a;
    --azss-amazon-dark: #131921;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.azss-storefront {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ── Light Scheme (default) ──────────────────────────── */
.azss-scheme-light.azss-storefront,
.azss-scheme-light.azss-single-product {
    --azss-bg: #f8f9fa;
    --azss-card-bg: #ffffff;
    --azss-border: rgba(0, 0, 0, 0.07);
    --azss-text: #0f1111;
    --azss-text-secondary: #565959;
    --azss-text-muted: #8d9096;
    --azss-price-color: #0f1111;
    --azss-star-color: #de7921;
    --azss-badge-bg: rgba(245, 166, 35, 0.1);
    --azss-badge-text: #c7511f;
    --azss-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --azss-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ── Dark Scheme ─────────────────────────────────────── */
.azss-scheme-dark.azss-storefront,
.azss-scheme-dark.azss-single-product {
    --azss-bg: #0f1318;
    --azss-card-bg: #1a1f2e;
    --azss-border: rgba(255, 255, 255, 0.06);
    --azss-text: #f0f2f5;
    --azss-text-secondary: #a0a8b8;
    --azss-text-muted: #6b7280;
    --azss-price-color: #f0f2f5;
    --azss-star-color: #de7921;
    --azss-badge-bg: rgba(245, 166, 35, 0.12);
    --azss-badge-text: #f5a623;
    --azss-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --azss-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* ── Store Header ────────────────────────────────────── */
.azss-store-header {
    text-align: center;
    margin-bottom: 40px;
}

.azss-store-title {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.azss-store-subtitle {
    font-size: 15px;
    color: var(--azss-text-secondary);
    margin: 0 0 14px;
    font-weight: 400;
}

.azss-store-count {
    display: inline-block;
    background: var(--azss-badge-bg);
    color: var(--azss-badge-text);
    padding: 5px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ── Product Grid ────────────────────────────────────── */
.azss-product-grid {
    display: grid;
    grid-template-columns: repeat(var(--azss-columns, 4), 1fr);
    gap: var(--azss-gap);
}

/* ── Product Card ────────────────────────────────────── */
.azss-product-card {
    background: var(--azss-card-bg);
    border: 1px solid var(--azss-border);
    border-radius: var(--azss-radius);
    box-shadow: var(--azss-shadow);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.azss-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--azss-shadow-hover);
}

/* Sponsored Badge */
.azss-badge-sponsored {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Product Image */
.azss-product-image-link {
    text-decoration: none !important;
    display: block;
}

.azss-product-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.azss-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
    transition: transform 0.4s ease;
}

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

.azss-placeholder-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ddd;
}

/* Product Info */
.azss-product-info {
    padding: 16px 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.azss-product-title-link {
    text-decoration: none !important;
}

.azss-product-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--azss-text);
    margin: 0 0 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.azss-product-title-link:hover .azss-product-title {
    color: var(--azss-amazon-orange);
    text-decoration: none !important;
}

/* Star Rating */
.azss-product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.azss-stars {
    position: relative;
    display: inline-block;
    font-size: 14px;
    line-height: 1;
}

.azss-stars-bg {
    color: var(--azss-text-muted);
    opacity: 0.25;
}

.azss-stars-fill {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    white-space: nowrap;
    color: var(--azss-star-color);
}

.azss-rating-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--azss-text-secondary);
}

.azss-reviews-count {
    font-size: 12px;
    color: var(--azss-text-muted);
}

/* Bought Count */
.azss-bought-count {
    font-size: 12px;
    color: var(--azss-text-muted);
    margin-bottom: 16px;
}

/* Product Footer */
.azss-product-footer {
    margin-top: auto;
    padding-top: 4px;
}

.azss-product-price {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--azss-price-color);
    margin-bottom: 14px;
}

/* Main CTA Button — Full width, pill shape, Amazon orange */
.azss-product-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--azss-amazon-orange);
    color: #000;
    text-decoration: none !important;
    padding: 12px 20px;
    border-radius: var(--azss-radius-pill);
    font-size: 14px;
    font-weight: 700;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
}

.azss-product-btn:hover {
    background: var(--azss-amazon-orange-hover);
    box-shadow: 0 3px 12px rgba(245, 166, 35, 0.35);
    color: #000;
}

/* ── Pagination ──────────────────────────────────────── */
.azss-storefront .azss-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.azss-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: var(--azss-radius-sm);
    background: var(--azss-card-bg);
    border: 1px solid var(--azss-border);
    color: var(--azss-text-secondary);
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.azss-page-link:hover {
    background: var(--azss-amazon-orange);
    color: #000;
    border-color: var(--azss-amazon-orange);
}

.azss-page-current {
    background: var(--azss-amazon-orange);
    color: #000;
    border-color: var(--azss-amazon-orange);
    font-weight: 700;
}

.azss-page-prev,
.azss-page-next {
    font-weight: 600;
}

.azss-page-ellipsis {
    border: none;
    background: transparent;
    color: var(--azss-text-muted);
    cursor: default;
    pointer-events: none;
    min-width: auto;
    padding: 0 6px;
}

/* ── Empty / Not Found ───────────────────────────────── */
.azss-empty-store {
    text-align: center;
    padding: 80px 20px;
    color: var(--azss-text-muted);
    font-size: 16px;
}

.azss-not-found {
    text-align: center;
    color: var(--azss-text-muted);
    padding: 40px;
}

/* ══════════════════════════════════════════════════════ */
/* ── Single Product Detail Page                        */
/* ══════════════════════════════════════════════════════ */
.azss-single-product {
    max-width: 880px;
    margin: 0 auto;
    padding: 40px 24px;
}

.azss-single-card {
    background: var(--azss-card-bg);
    border: 1px solid var(--azss-border);
    border-radius: var(--azss-radius);
    box-shadow: var(--azss-shadow);
    overflow: hidden;
    display: flex;
    animation: azss-fade-in 0.4s ease backwards;
}

/* Image column */
.azss-single-image-col {
    flex: 0 0 42%;
    max-width: 42%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-decoration: none !important;
    border-right: 1px solid var(--azss-border);
    transition: opacity 0.2s;
}

.azss-single-image-col:hover {
    opacity: 0.9;
}

.azss-single-image-col img {
    width: 100%;
    height: auto;
    max-height: 380px;
    object-fit: contain;
}

/* Info column */
.azss-single-info-col {
    flex: 1;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.azss-single-title-link {
    text-decoration: none !important;
}

.azss-single-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--azss-text);
    margin: 0 0 14px;
    line-height: 1.45;
}

.azss-single-title-link:hover .azss-single-title {
    color: var(--azss-amazon-orange);
}

.azss-single-info-col .azss-product-rating {
    margin-bottom: 6px;
}

.azss-single-info-col .azss-bought-count {
    margin-bottom: 20px;
}

.azss-single-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--azss-price-color);
    margin-bottom: 20px;
}

/* Single Product CTA */
.azss-single-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--azss-amazon-orange);
    color: #000;
    text-decoration: none !important;
    padding: 14px 24px;
    border-radius: var(--azss-radius-pill);
    font-size: 16px;
    font-weight: 700;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
}

.azss-single-btn:hover {
    background: var(--azss-amazon-orange-hover);
    box-shadow: 0 4px 16px rgba(245, 166, 35, 0.4);
    color: #000;
}

/* Back link */
.azss-single-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--azss-text-muted);
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    margin-top: 20px;
    transition: color 0.2s;
}

.azss-single-back:hover {
    color: var(--azss-amazon-orange);
}

/* Single Product Responsive */
@media (max-width: 768px) {
    .azss-single-card {
        flex-direction: column;
    }

    .azss-single-image-col {
        flex: none;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--azss-border);
    }

    .azss-single-info-col {
        padding: 24px 20px;
    }
}

/* ── Animations ──────────────────────────────────────── */
@keyframes azss-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.azss-product-card {
    animation: azss-fade-in 0.4s ease backwards;
}

.azss-product-card:nth-child(1) {
    animation-delay: 0.02s;
}

.azss-product-card:nth-child(2) {
    animation-delay: 0.04s;
}

.azss-product-card:nth-child(3) {
    animation-delay: 0.06s;
}

.azss-product-card:nth-child(4) {
    animation-delay: 0.08s;
}

.azss-product-card:nth-child(5) {
    animation-delay: 0.10s;
}

.azss-product-card:nth-child(6) {
    animation-delay: 0.12s;
}

.azss-product-card:nth-child(7) {
    animation-delay: 0.14s;
}

.azss-product-card:nth-child(8) {
    animation-delay: 0.16s;
}

.azss-product-card:nth-child(9) {
    animation-delay: 0.18s;
}

.azss-product-card:nth-child(10) {
    animation-delay: 0.20s;
}

.azss-product-card:nth-child(11) {
    animation-delay: 0.22s;
}

.azss-product-card:nth-child(12) {
    animation-delay: 0.24s;
}

/* ── Responsive Grid ─────────────────────────────────── */
@media (max-width: 1200px) {
    .azss-product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .azss-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .azss-store-title {
        font-size: 26px;
    }
}

@media (max-width: 600px) {
    .azss-product-grid {
        grid-template-columns: 1fr;
    }

    .azss-storefront {
        padding: 20px 14px;
    }

    .azss-store-title {
        font-size: 22px;
    }
}