/*
Theme Name: AffCommerce Elite
Theme URI: http://example.com/affcommerce-elite/
Author: Your Name
Author URI: http://example.com
Description: An ultra-professional, conversion-optimized E-commerce Affiliate Discovery platform featuring a Soft Warm Orange Shopee-inspired aesthetic with advanced Organic Asymmetric Bento Grid layout, rich micro-interactions, and zero layout shifts.
Version: 2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: affcommerce-elite
*/

:root {
    --primary-orange: #EE4D2D;
    --primary-hover: #D73211;
    --primary-orange-hover: #D73211;
    --soft-bg: #F8F9FA;
    --bg-canvas: #F5F5F5;
    --card-bg: #FFFFFF;
    --border-subtle: #E5E7EB;
    --border-color: #E5E7EB;
    --border-highlight: #FFE5E0;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --shadow-card: 0 4px 20px -2px rgba(238, 77, 45, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 20px 30px -10px rgba(238, 77, 45, 0.15), 0 8px 12px -4px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main Container */
.aff-main-wrapper {
    max-width: 1240px;
    margin: 24px auto;
    padding: 0 20px;
    animation: fadeIn 0.5s ease-in;
}

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

/* Sticky Glassmorphic Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.site-header.scrolled {
    padding: 0.75rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-orange);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}

.site-logo svg rect {
    fill: var(--primary-orange);
    transition: fill 0.3s ease;
}

.site-logo svg path:last-child {
    fill: var(--primary-orange);
    transition: fill 0.3s ease;
}

.site-logo:hover svg rect,
.site-logo:hover svg path:last-child {
    fill: var(--primary-hover);
}

.header-center {
    flex: 1;
    max-width: 600px;
}

.search-bar {
    width: 100%;
    padding: 0.75rem 1.25rem 0.75rem 3rem;
    border: 2px solid var(--border-subtle);
    border-radius: 50px;
    font-size: 1rem;
    background: var(--soft-bg);
    transition: all 0.3s ease;
    position: relative;
    color: var(--text-main);
}

.search-bar::placeholder {
    color: var(--text-muted);
}

.search-bar:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 4px rgba(238, 77, 45, 0.1), 0 4px 12px rgba(238, 77, 45, 0.15);
    transform: scale(1.01);
}

.search-form {
    position: relative;
}

.search-form::before {
    content: '🔍';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-icon {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

.header-icon:hover {
    color: var(--primary-orange);
}

/* HERO BENTO GRID */
.hero-bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.hero-main {
    grid-column: span 8;
    background: linear-gradient(135deg, #FF6633 0%, #EE4D2D 100%);
    border-radius: 20px;
    padding: 32px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 10px 25px rgba(238, 77, 45, 0.2);
}

.hero-main::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    transform: rotate(15deg);
    pointer-events: none;
}

.brand-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: #FFF;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 16px;
    align-self: flex-start;
}

.hero-main h1 {
    font-size: 32px;
    margin: 16px 0 10px;
    color: #fff;
    line-height: 1.2;
    font-weight: 800;
}

.hero-main p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 24px;
    font-size: 15px;
    max-width: 80%;
}

.btn-cta {
    background: #fff;
    color: var(--primary-orange);
    padding: 12px 28px;
    border-radius: 24px;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    align-self: flex-start;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    background: #FFF8F6;
}

/* Hero Banner Indicators */
.hero-indicators {
    position: absolute;
    bottom: 20px;
    left: 24px;
    display: flex;
    gap: 8px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(238, 77, 45, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--primary-orange);
    transform: scale(1.2);
}

.indicator:hover {
    background: rgba(238, 77, 45, 0.6);
}

.hero-side {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-side-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.hero-side-card:hover {
    border-color: var(--primary-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.1);
}

.hero-side-card h3 {
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--primary-orange);
    font-weight: 700;
}

.hero-side-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* CATEGORY CAPSULES */
.categories-bar {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-orange) var(--soft-bg);
}

.categories-bar::-webkit-scrollbar {
    height: 6px;
}

.categories-bar::-webkit-scrollbar-track {
    background: var(--soft-bg);
    border-radius: 3px;
}

.categories-bar::-webkit-scrollbar-thumb {
    background: var(--primary-orange);
    border-radius: 3px;
}

.category-capsule {
    background: #fff;
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.category-capsule:hover,
.category-capsule.active {
    background: var(--soft-bg);
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(238, 77, 45, 0.1);
    font-weight: 700;
}

/* FLASH SALE SECTION */
.flash-sale-section {
    margin-bottom: 32px;
}

.flash-sale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.flash-sale-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.flash-sale-title h2 {
    font-size: 24px;
    color: var(--text-main);
}

.countdown-timer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.countdown-time {
    background: linear-gradient(135deg, var(--primary-orange), #FF6633);
    color: #FFF;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(238, 77, 45, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.see-all-link {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

.see-all-link:hover {
    color: var(--primary-orange-hover);
}

.flash-sale-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.flash-sale-card {
    background: #FFF;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.flash-sale-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.flash-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: var(--soft-bg);
}

.flash-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #FF4500, #EE4D2D);
    color: #FFF;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(238, 77, 45, 0.3);
}

.flash-content {
    padding: 12px;
}

.flash-content h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flash-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.flash-sale-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-orange);
}

.flash-original-price {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.progress-bar {
    position: relative;
    height: 16px;
    background: var(--soft-bg);
    border-radius: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-orange), #FF6633);
    border-radius: 8px;
    transition: width 0.3s ease;
}

.sold-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-main);
}

/* BRAND HUB SECTION */
.brand-hub-section {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.brand-promo-panel {
    background: linear-gradient(135deg, var(--primary-orange), #FF6633);
    border-radius: 16px;
    padding: 24px;
    color: #FFF;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.3);
}

.brand-promo-content h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.brand-promo-content p {
    font-size: 14px;
    margin-bottom: 16px;
    opacity: 0.9;
}

.brand-cta {
    background: #FFF;
    color: var(--primary-orange);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.brand-cta:hover {
    background: var(--soft-bg);
}

.brand-logo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.brand-logo-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.brand-logo-card:hover {
    border-color: var(--primary-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.1);
}

.brand-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.brand-discount {
    font-size: 12px;
    color: var(--primary-orange);
    font-weight: 600;
}

/* MAIN CATALOG BENTO GRID */
.catalog-bento-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

/* Product Card */
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-card);
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-orange);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #FF4500, #EE4D2D);
    color: #fff;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(238, 77, 45, 0.3);
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: #F3F4F6;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.product-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.merchant-label {
    font-size: 10px;
    color: var(--primary-orange);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.product-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: var(--primary-orange);
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.sale-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-orange);
}

.regular-price {
    font-size: 12px;
    color: #9CA3AF;
    text-decoration: line-through;
}

.cta-button {
    margin-top: auto;
    background: #FFF1ED;
    color: var(--primary-orange);
    border: 1px solid var(--border-highlight);
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}

.cta-button:hover {
    background: var(--primary-orange);
    color: #fff;
    border-color: var(--primary-orange);
    transform: scale(1.02);
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-content {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 900px;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.lightbox-image {
    width: 100%;
    height: auto;
    border-radius: 16px 16px 0 0;
}

.lightbox-gallery {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

.lightbox-gallery img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.lightbox-gallery img:hover {
    opacity: 0.8;
}

/* Mobile Bottom Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    z-index: 1000;
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: color 0.3s ease;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--primary-orange);
}

.mobile-nav-icon {
    font-size: 1.5rem;
}

/* Footer */
.site-footer {
    background: var(--soft-bg);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 60px;
    border-top: 1px solid var(--border-subtle);
}

.footer-copyright p {
    margin: 0.5rem 0;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .catalog-bento-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .flash-sale-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .brand-logo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 0.75rem 1rem;
        gap: 1rem;
    }

    .header-center {
        max-width: 200px;
    }

    .header-right {
        gap: 1rem;
    }

    .main-container {
        margin: 10px auto;
        padding: 0 12px;
    }

    .hero-bento-grid {
        grid-template-columns: 1fr;
    }

    .hero-main,
    .hero-side {
        grid-column: span 1;
    }

    .hero-main {
        min-height: 200px;
    }

    .hero-main h1 {
        font-size: 20px;
    }

    .brand-hub-section {
        grid-template-columns: 1fr;
    }

    .catalog-bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .flash-sale-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .brand-logo-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .mobile-nav {
        display: block;
    }

    .product-title {
        font-size: 12px;
    }

    .sale-price {
        font-size: 14px;
    }

    .cta-button {
        font-size: 11px;
        padding: 6px;
    }
}

@media (max-width: 480px) {
    .catalog-bento-grid {
        grid-template-columns: 1fr;
    }

    .flash-sale-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .brand-logo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
