/* =============================================
   Ellis Trading — Main Stylesheet
   ============================================= */

:root {
    --color-bg: #0f0b14;
    --color-bg-alt: #1a1423;
    --color-bg-card: #1e1830;
    --color-primary: #c9a84c;
    --color-primary-hover: #dbb85d;
    --color-primary-dark: #b8943e;
    --color-text: #e8e4ef;
    --color-text-muted: #9a93b0;
    --color-text-dark: #4a4560;
    --color-border: #2a2440;
    --color-accent-wine: #8b1a1a;
    --color-accent-beauty: #7b2d8b;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --max-width: 1200px;
    --header-height: 72px;
    --radius: 12px;
    --radius-sm: 8px;
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Focus styles for accessibility */
*:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

a:focus, button:focus {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================
   Header
   ============================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 11, 20, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
}

.logo__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: var(--color-bg);
    border-radius: 8px;
    font-size: 1.1rem;
}

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

/* Navigation */
.nav__list { display: flex; gap: 32px; }

.nav__link {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color 0.2s;
    position: relative;
    padding: 8px 0;
}

.nav__link:hover,
.nav__link.active {
    color: var(--color-text);
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s;
}

.nav__link:hover::after,
.nav__link.active::after { width: 100%; }

/* Dropdown */
.nav__item--dropdown { position: relative; }

.dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 50;
}

.nav__item--dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(4px);
}

.dropdown__link {
    display: block;
    padding: 8px 16px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.dropdown__link:hover {
    background: rgba(201, 168, 76, 0.1);
    color: var(--color-primary);
}

/* Header actions */
.header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-toggle,
.cart-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
}

.cart-btn svg {
    width: 26px;
    height: 26px;
}

.search-toggle:hover,
.cart-btn:hover {
    background: rgba(255,255,255,0.05);
    color: var(--color-text);
}

.cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--color-primary);
    color: var(--color-bg);
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile menu btn */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s;
}

/* Search Overlay */
.search-overlay {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 20px 0;
    display: none;
    z-index: 99;
}

.search-overlay.active { display: block; }

.search-input {
    width: 100%;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    color: var(--color-text);
    font-size: 1rem;
    outline: none;
}

.search-input:focus {
    border-color: var(--color-primary);
}

.search-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* =============================================
   Hero
   ============================================= */
.hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
    margin-top: var(--header-height);
}

.hero__slides {
    height: 100%;
    position: relative;
}

.hero__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    background-size: cover;
    background-position: center;
}

.hero__slide.active { opacity: 1; }

.hero__content {
    max-width: 600px;
}

.hero__title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero__subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

.hero__dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.hero__dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--color-text-muted);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s;
}

.hero__dots button.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.hero__prev,
.hero__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 5;
}

.hero__prev { left: 20px; }
.hero__next { right: 20px; }

.hero__prev:hover,
.hero__next:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-bg);
}

/* =============================================
   Sections
   ============================================= */
.section {
    padding: 80px 0;
}

.section__title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
}

.section__subtitle {
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 48px;
    font-size: 1rem;
}

/* Categories */
.categories__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-card {
    position: relative;
    border-radius: var(--radius);
    padding: 40px 32px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.category-card:hover {
    transform: translateY(-4px);
}

.category-card__title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.category-card__desc {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

/* Products Grid */
.products__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.product-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid var(--color-border);
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: 0 12px 40px rgba(201, 168, 76, 0.08);
}

.product-card__image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: var(--color-bg-alt);
}

.product-card__body {
    padding: 16px 20px 20px;
}

.product-card__brand {
    font-size: 0.7rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.product-card__name {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* Brands */
.brands__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.brand-chip {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    padding: 12px 28px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: all 0.2s;
    cursor: pointer;
}

.brand-chip:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(201, 168, 76, 0.05);
}

/* =============================================
   Buttons
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn--outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn--outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn--full { width: 100%; }
.btn--sm { padding: 8px 20px; font-size: 0.8rem; }

/* =============================================
   Cart Sidebar
   ============================================= */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--color-bg-card);
    border-left: 1px solid var(--color-border);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.cart-sidebar.open { right: 0; }

.cart-sidebar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
}

.cart-sidebar__header h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.cart-sidebar__header button {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.3rem;
    cursor: pointer;
}

.cart-sidebar__items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-height: calc(100vh - 140px);
    -webkit-overflow-scrolling: touch;
}

.cart-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
}

.cart-item__img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: var(--color-bg-secondary, #1a1423);
}

.cart-item__info {
    flex: 1;
    min-width: 0;
}

.cart-item__name {
    font-size: 0.9rem;
    margin: 0 0 2px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item__price {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0 0 8px;
}

.cart-item__qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item__qty button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    padding: 0;
}

.cart-item__qty span {
    min-width: 20px;
    text-align: center;
    font-weight: 600;
}

.cart-item__remove {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.cart-item__remove:hover {
    opacity: 1;
    color: #e74c3c;
}

.cart-empty {
    color: var(--color-text-muted);
    text-align: center;
    padding: 40px 0;
}

.cart-sidebar__footer {
    padding: 20px;
    border-top: 1px solid var(--color-border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 1.05rem;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 150;
    display: none;
}

.overlay.active { display: block; }

/* =============================================
   Footer
   ============================================= */
.footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer__heading {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.footer__text {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer__links li {
    margin-bottom: 10px;
}

.footer__links a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-link {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

.footer__bottom {
    border-top: 1px solid var(--color-border);
    padding-top: 20px;
    text-align: center;
    color: var(--color-text-dark);
    font-size: 0.85rem;
}

/* =============================================
   Product Detail Page
   ============================================= */
.product-detail {
    margin-top: var(--header-height);
    padding: 60px 0;
}

.product-detail__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.product-detail__image {
    width: 100%;
    border-radius: var(--radius);
    background: var(--color-bg-alt);
}

.product-detail__brand {
    font-size: 0.75rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.product-detail__name {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin: 12px 0 16px;
}

.product-detail__price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 24px;
}

.product-detail__desc {
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: 32px;
}

/* =============================================
   Category / Listing Page
   ============================================= */
.category-page {
    margin-top: var(--header-height);
    padding: 40px 0;
}

.category-page__title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.category-page__count {
    color: var(--color-text-muted);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.filters-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.filter-btn {
    padding: 8px 20px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 1024px) {
    .categories__grid { grid-template-columns: repeat(2, 1fr); }
    .products__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .nav { display: none; }
    .mobile-menu-btn { display: flex; }

    .hero__title { font-size: 2.2rem; }
    .hero { height: 50vh; min-height: 400px; }

    .products__grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .categories__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .footer__grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
    .product-detail__inner { grid-template-columns: 1fr; gap: 30px; }
    .cart-sidebar { width: 100%; right: -100%; }
    .section { padding: 60px 0; }
}

@media (max-width: 480px) {
    .products__grid { grid-template-columns: 1fr; }
    .categories__grid { grid-template-columns: 1fr; }
    .hero__title { font-size: 1.8rem; }
}
