:root {
    --bg-main: #ffffff;
    --bg-alt: #f8fafb;
    --primary: #2A0E4D;
    /* Deep Purple */
    --primary-hover: #1f0a3a;
    --primary-light: #f3f0f7;
    --accent: #FB7A97;
    /* Pink */
    --accent-hover: #f95d81;
    --secondary: #0f172a;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #ededed;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-main);
    color: var(--text);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    /* Centered content with room for side ads on desktop */
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Navigation */
header {
    background: white;
    border-bottom: 1px solid var(--border);
    height: 140px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-img {
    height: 120px;
    object-fit: contain;
}

/* Homepage Hero (PriceRunner Style) */
.homepage-hero {
    background-color: var(--primary);
    color: white;
    padding: 5rem 0 6rem;
    text-align: center;
}

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

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

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

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 3rem;
}

.hero-search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-search-form {
    display: flex;
    background: white;
    padding: 0.5rem;
    border-radius: 99px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.hero-search-input {
    flex: 1;
    border: none;
    padding: 0 1.5rem;
    font-size: 1.125rem;
    border-radius: 99px;
    outline: none;
    color: var(--text);
}

.hero-search-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 99px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.hero-search-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.popular-searches {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

.popular-searches a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.popular-searches a:hover {
    border-color: white;
}

/* Category Icon Strip */
.category-icon-strip {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
}

.category-strip-inner {
    display: flex;
    justify-content: center;
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.category-strip-inner::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.cat-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition);
}

.cat-pill span {
    font-size: 1.25rem;
}

.cat-pill:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

/* Sticky Category Nav */
/* Sticky Category Nav */
.category-nav-sticky {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 140px;
    z-index: 999;
    max-height: calc(100vh - 140px);
    overflow-y: visible;
    /* Allow mega menus to overflow */
}

.category-nav-inner {
    display: flex;
    gap: 0;
    min-height: 48px;
    align-items: center;
    flex-wrap: wrap;
    /* Allow wrapping for expanded view */
    padding: 0;
    position: relative;
}

/* Mega Menu Styles */
.category-item-group {
    position: relative;
    height: 48px;
    /* Fixed height for items to align nicely */
    display: flex;
    align-items: center;
}

.category-nav-link {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    border-top: 2px solid transparent;
    /* Balance border */
}

.category-nav-link:hover {
    color: var(--primary);
    background: var(--bg-alt);
}

.category-item-group:hover .category-nav-link {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-alt);
}

.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border);
    border-top: none;
    min-width: 450px;
    /* Wider for 2 cols */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-radius: 0 0 8px 8px;
    padding: 0.5rem 0;
}

.category-item-group:hover .mega-menu {
    display: block;
}

.mega-menu-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.mega-menu-item {
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.mega-menu-item:hover {
    background: var(--bg-alt);
    color: var(--primary);
    padding-left: 1.75rem;
}

.mega-menu-show-more {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: var(--transition);
}

.mega-menu-show-more:hover {
    text-decoration: underline;
}

.mega-menu-show-more {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: var(--transition);
}

.mega-menu-show-more:hover {
    text-decoration: underline;
}

.category-nav-link {
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
}

.category-nav-link:hover {
    color: var(--primary);
}

/* Banded Sections */
.homepage-band {
    padding: 4rem 0;
}

.bg-white {
    background-color: white;
}

.bg-alt {
    background-color: var(--bg-alt);
}

.band-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.band-title {
    font-size: 1.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.band-title .icon {
    font-size: 1.5rem;
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9375rem;
}

.view-all:hover {
    text-decoration: underline;
}

/* Product Cards & Layouts */
.products-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 0.5rem 0 2rem;
    scrollbar-width: thin;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
}

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

.card-discount {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--accent);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    z-index: 2;
}

.card-image {
    padding: 1.5rem;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.card-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5rem;
    line-height: 1.25;
}

.card-meta {
    margin-bottom: 1rem;
}

.card-stores {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.card-price {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.price-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
}

/* Trust Band */
.trust-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.trust-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.trust-icon {
    font-size: 2rem;
    line-height: 1;
}

.trust-item h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.trust-item p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.in-feed-ad-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed var(--border);
}

@media (max-width: 991px) {
    .trust-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2rem;
    }
}

/* Detail Page */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    margin-top: 2rem;
}

.detail-img-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3rem;
    height: 540px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-p-name {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.detail-price-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
}

.retailer-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

.retailer-table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
}

.retailer-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.btn-blue {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-blue:hover {
    background-color: var(--primary-hover);
}

/* Site Footer */
.site-footer {
    background-color: var(--bg-alt);
    padding: 5rem 0 3rem;
    border-top: 1px solid var(--border);
    margin-top: 5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-logo {
    height: 32px;
    margin-bottom: 1.5rem;
}

.footer-tagline {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.footer-list {
    list-style: none;
    padding: 0;
}

.footer-list li {
    margin-bottom: 0.75rem;
}

.footer-list a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: var(--transition);
}

.footer-list a:hover {
    color: var(--primary);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

@media (max-width: 991px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Ad Rails in Side Gutters */
.page-with-ads {
    display: flex;
    justify-content: center;
    gap: 0;
}

.page-with-ads main {
    flex: 1;
    max-width: 1200px;
    min-width: 0;
}

.ad-rail {
    width: 160px;
    position: sticky;
    top: 200px;
    height: fit-content;
    padding: 1rem 0.5rem;
    display: none;
}

.ad-rail-left {
    margin-right: 1rem;
}

.ad-rail-right {
    margin-left: 1rem;
}

@media (min-width: 1500px) {
    .ad-rail {
        display: block;
    }
}

@media (min-width: 1700px) {
    .ad-rail {
        width: 200px;
    }
}