/* 
 * Premium E-commerce Theme — Dynamic Variables
 * :root values are overridden by inline <style> in header.php from admin settings
 */

:root {
    --primary: #2d3436;
    --secondary: #636e72;
    --accent: #00b894;
    --success: #00b894;
    --danger: #d63031;
    --background: #fdfdfd;
    --text-dark: #2d3436;
    --text-muted: #636e72;
    --border-color: #dfe6e9;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --radius-lg: 12px;
}

/* ==================== Base ==================== */
body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

html {
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    transition: all 0.3s ease;
    text-decoration: none;
}

a:hover {
    color: var(--secondary);
}

/* ==================== Animations ==================== */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

/* ==================== Top Bar Modern ==================== */
.top-bar-modern {
    background: #f8f9fa;
    color: var(--secondary);
    font-size: 0.75rem;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
}

.top-bar-modern a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.top-bar-modern a:hover {
    color: var(--primary);
}

/* ==================== Header / Navbar ==================== */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 15px 0;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-icon-link {
    color: var(--secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.05em;
}

.header-icon-link:hover {
    color: var(--accent);
    transform: translateY(-1px);
}

.header-icon-link i {
    font-size: 1.1rem;
}

.search-container {
    max-width: 600px;
    width: 100%;
    position: relative;
}

.search-input {
    border-radius: 12px;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    background: #f1f3f5;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.1);
    background: var(--white);
    outline: none;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--secondary);
    padding: 0 15px;
    transition: color 0.3s ease;
}

.search-btn:hover {
    color: var(--accent);
    background: transparent !important;
}

/* ==================== Buttons ==================== */
.btn-premium {
    background: var(--primary);
    color: var(--white);
    border-radius: 8px;
    padding: 12px 28px;
    font-weight: 600;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.02em;
    font-size: 0.85rem;
    font-family: 'Outfit', sans-serif;
}

.btn-premium:hover {
    background: #000;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-primary:hover {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

/* ==================== Age Navigation ==================== */
.age-nav-container {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.age-nav {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.age-nav-link {
    display: block;
    padding: 12px 20px;
    color: var(--secondary);
    font-weight: 500;
    font-size: 0.85rem;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}

.age-nav-link:hover {
    color: var(--accent);
    background: rgba(0, 184, 148, 0.03);
}

.age-nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

@media (max-width: 767.98px) {
    .age-nav-link {
        padding: 12px 10px;
        font-size: 0.75rem;
    }
}

/* ==================== Hero Carousel ==================== */
.hero-carousel {
    position: relative;
    overflow: hidden;
}

.hero-carousel .carousel-item {
    height: 520px;
    background: linear-gradient(135deg, var(--secondary) 0%, #1a1a2e 100%);
}

@media (max-width: 767.98px) {
    .hero-carousel .carousel-item {
        height: 400px;
    }
}

.hero-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

.hero-carousel .carousel-caption {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 60px;
    text-align: left;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
}

@media (max-width: 767.98px) {
    .hero-carousel .carousel-caption {
        padding: 0 24px;
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%);
        align-items: flex-end;
        padding-bottom: 40px;
    }
}

.hero-content {
    max-width: 560px;
}

.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: white;
    line-height: 1.15;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 767.98px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }
}

.hero-content .badge.bg-accent {
    background: var(--accent) !important;
    color: var(--text-dark);
    font-size: 0.7rem;
}

.hero-carousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    margin: 0 5px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.hero-carousel .carousel-indicators button.active {
    opacity: 1;
    width: 28px;
    border-radius: 5px;
    background: var(--accent);
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 50px;
    height: 50px;
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    margin: 0 16px;
    opacity: 0;
    transition: all 0.3s ease;
}

.hero-carousel:hover .carousel-control-prev,
.hero-carousel:hover .carousel-control-next {
    opacity: 1;
}

.hero-carousel .carousel-control-prev:hover,
.hero-carousel .carousel-control-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== Trending Category Nav ==================== */
.trending-nav-item {
    text-align: center;
    padding: 16px 8px;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.trending-nav-item:hover {
    background: var(--white);
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.trending-nav-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(128, 0, 32, 0.08), rgba(0, 0, 128, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.trending-nav-item:hover .trending-nav-icon {
    border-color: var(--primary);
}

.trending-nav-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== Product Cards ==================== */
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 12px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
}

.product-image-wrapper {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #f5f5f7;
    margin-bottom: 14px;
    aspect-ratio: 1/1;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.08);
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
    letter-spacing: 0.3px;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info .product-brand {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    margin-bottom: 4px;
    display: block;
}

.product-name {
    font-size: 0.92rem;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.6rem;
    line-height: 1.3;
}

.product-name a {
    color: var(--text-dark);
}

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

.price-box {
    margin-top: auto;
    padding-top: 6px;
}

.current-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
}

.old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 6px;
}

/* ==================== PDP Swatches ==================== */
.swatch-item {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.swatch-item.active {
    box-shadow: 0 0 0 2px var(--primary);
    transform: scale(1.1);
}

.size-item {
    min-width: 48px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.size-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ==================== Sticky Cart ==================== */
.sticky-cart-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    display: none;
}

@media (max-width: 991.98px) {
    .sticky-cart-mobile {
        display: block;
    }

    .product-gallery {
        height: auto !important;
    }
}

/* ==================== Footer ==================== */
.footer-main {
    background: #1a1a2e;
    color: #c5c6d0;
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-main h5,
.footer-main h6 {
    color: var(--white);
}

.footer-heading {
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    color: var(--white) !important;
    position: relative;
    padding-bottom: 10px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.footer-links {
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #a0a1b2;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 4px;
}

.footer-icon-circle {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.85rem;
}

.footer-newsletter .form-control {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    border-radius: 50px 0 0 50px;
    padding: 10px 18px;
    font-size: 0.88rem;
}

.footer-newsletter .form-control::placeholder {
    color: #8a8b9a;
}

.footer-newsletter .form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
    box-shadow: none;
}

.footer-newsletter .btn {
    border-radius: 0 50px 50px 0;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a1b2;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* ==================== Section Headers ==================== */
.section-heading {
    position: relative;
    padding-bottom: 12px;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.popular-search-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.search-pill {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a1b2 !important;
    border-radius: 50px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.search-pill:hover {
    background: var(--primary);
    color: white !important;
    border-color: var(--primary);
}

/* ==================== Utilities ==================== */
.letter-spacing-1 {
    letter-spacing: 1px;
}

.fw-800 {
    font-weight: 800;
}

.fw-900 {
    font-weight: 900;
}

.text-light-muted {
    color: #e9ecef;
}

.object-fit-contain {
    object-fit: contain;
}

.object-fit-cover {
    object-fit: cover;
}

.text-accent {
    color: var(--accent) !important;
}

.bg-accent {
    background-color: var(--accent) !important;
}

/* ==================== Category Section Cards ==================== */
.category-section-card {
    transition: all 0.3s ease;
    border-radius: var(--radius-lg) !important;
}

.category-section-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.category-section-card .card-img-top-wrapper img {
    transition: transform 0.4s ease;
}

.category-section-card:hover .card-img-top-wrapper img {
    transform: scale(1.06);
}

/* ==================== Mobile Bottom Navigation ==================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    /* hidden by default, shown via media query */
    justify-content: space-around;
    align-items: center;
    padding: 6px 0 env(safe-area-inset-bottom, 4px);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
    z-index: 1060;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 767.98px) {
    .mobile-bottom-nav {
        display: flex;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    transition: color 0.2s ease;
    position: relative;
}

.mobile-nav-item i {
    font-size: 1.15rem;
    margin-bottom: 2px;
}

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

.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

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

/* ==================== Responsive Tweaks ==================== */
@media (max-width: 575.98px) {
    .product-card {
        padding: 10px;
    }

    .product-name {
        font-size: 0.82rem;
        height: 2.2rem;
    }

    .current-price {
        font-size: 1rem;
    }

    .btn-premium {
        padding: 8px 16px;
        font-size: 0.75rem;
    }

    .hero-carousel .carousel-item {
        height: 280px;
    }

    .hero-content h1 {
        font-size: 1.4rem;
    }

    .hero-content .lead {
        font-size: 0.85rem !important;
    }

    .hero-content .btn-premium {
        padding: 10px 24px;
        font-size: 0.75rem;
    }

    .display-5 {
        font-size: 1.5rem !important;
    }

    .age-icon-wrapper img {
        width: 60px !important;
        height: 60px !important;
    }

    .trending-nav-icon {
        width: 60px;
        height: 60px;
    }

    .container.py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

@media (max-width: 767.98px) {

    /* Prevent horizontal overflow */
    html,
    body {
        overflow-x: hidden;
    }

    /* Footer responsive */
    .footer-main {
        padding: 40px 0 80px;
        /* extra bottom for mobile nav */
    }

    /* Sticky cart adjustment for mobile bottom nav */
    .sticky-cart-mobile {
        bottom: 56px;
    }
}