/* Global Variables */
:root {
    --primary-color: #00695C;
    /* Deep Teal - Sophisticated, distinct from red */
    --primary-hover: #004D40;
    --accent-color: #FDD835;
    /* Gold Accent - Early Bird / Premium feel */
    --accent-hover: #FBC02D;

    --bg-dark: #121212;
    --header-bg: #FFFFFF;
    /* White header for clean, modern look */
    --nav-bg: #F8F9FA;

    --text-white: #ffffff;
    --text-black: #212121;
    --text-gray: #757575;

    --border-color: #e0e0e0;
    --card-bg: #ffffff;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.12);
    --primary-red: #D32F2F;
}

* {
    box-sizing: border-box;
}

/* Base Styles */
body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: var(--text-black);
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Courier Prime', monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0;
    color: var(--text-black);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

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

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Layout */
/* Layout */
.container {
    width: 95%;
    /* Use more screen width */
    max-width: 1500px;
    /* Allow wider layout on large screens */
    margin: 10px auto;
    padding: 10px 0;
    /* Reduced side padding (width handles it) */
    min-height: 80vh;
    position: relative;
    /* Create stacking context */
    z-index: 1;
    /* Lower than nav (9998) */
}

/* Header */
header {
    background-color: var(--header-bg);
    color: var(--text-black);
    /* Dark text on white header */
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

header .logo h1 {
    margin: 0;
    font-size: 2.2rem;
    color: var(--primary-color);
    text-shadow: none;
    letter-spacing: 2px;
}

header .user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-black);
}

header .user-actions a {
    color: var(--text-black);
    opacity: 0.8;
}

header .user-actions a:hover {
    color: var(--primary-color);
    opacity: 1;
}

/* Navigation */
nav {
    background-color: var(--nav-bg);
    text-align: center;
    box-shadow: inset 0 -1px 0 #eee;
    /* Subtle separator */
    position: sticky;
    top: 0;
    z-index: 9998;
    /* High z-index for sticky nav */
}

nav a {
    display: inline-block;
    padding: 18px 24px;
    color: var(--text-black);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 3px solid transparent;
    /* Thicker active line */
}

nav a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--text-white);
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    /* modern rounding */
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

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

/* Forms */
.form-group {
    margin-bottom: 20px;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 105, 92, 0.1);
    /* Teal glow */
}

/* Auth Container */
.auth-container {
    max-width: 450px;
    margin: 60px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid #eee;
}

.auth-container h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.auth-container label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    text-align: left;
}

.auth-container .form-group {
    text-align: left;
}

/* Top Bar */
.top-bar {
    background-color: #f5f5f5;
    /* Light grey instead of black */
    color: #666;
    padding: 8px 40px;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    font-weight: 500;
}

.top-bar a {
    color: #555;
    margin-left: 15px;
    opacity: 1;
    text-decoration: none;
}

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

.top-bar .notice {
    font-style: italic;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    /* Ensure it stays on top of everything */
    top: 100%;
    left: 0;
    border: 1px solid #eee;
    padding: 10px 0;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.15s ease-out;
}

.dropdown-content a {
    color: var(--text-black);
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    border-bottom: none;
    text-transform: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.dropdown-content a:hover {
    background-color: #f0f7f6;
    /* Very light teal tint */
    color: var(--primary-color);
}

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

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

/* Footer */
footer {
    background-color: #212121;
    color: #9e9e9e;
    padding: 60px 20px;
    text-align: center;
    margin-top: auto;
    border-top: 4px solid var(--primary-color);
}

footer strong {
    color: #fff;
    margin-bottom: 5px;
    display: block;
}

footer p {
    margin: 8px 0;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.product-card {
    background: #fff;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    /* Stronger shadow */
}

.product-card img {
    border-bottom: 1px solid #f0f0f0;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Smooth cubic bezier */
}

.product-card:hover img {
    transform: scale(1.08);
    /* Increased zoom from 1.05 */
}

.product-card h3 {
    margin: 20px 20px 10px;
    font-size: 1.2rem;
}

.product-card p {
    padding: 0 20px;
    color: #666;
}

.product-card .price {
    padding: 0 20px 20px;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color) !important;
    margin-top: auto;
}

.cart-badge {
    background: var(--accent-color);
    color: #000;
    padding: 2px 8px;
    font-weight: bold;
    border-radius: 12px;
}

/* New Category Nav Links */
.category-link {
    margin-left: 0 !important;
    /* Reset legacy margin */
    font-weight: 500;
    color: var(--text-black);
    text-decoration: none;
}

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

/* Cart Drawer */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 20000;
    /* Must cover nav (9998) */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: #fff;
    z-index: 20001;
    /* Highest priority */
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
}

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

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #fff;
}

/* Catalog Layout (Sidebar Left) */
.catalog-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    /* Narrower sidebar */
    gap: 20px;
    /* Minimal gap */
    align-items: start;
    margin-top: 5px;
}

.catalog-sidebar {
    position: sticky;
    top: 80px;
    height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
}

.catalog-main {
    min-width: 0;
    /* Prevents grid blowout */
}

/* Responsive Catalog */
@media (max-width: 900px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .catalog-sidebar {
        position: static;
        height: auto;
        margin-bottom: 30px;
        border-bottom: 1px solid #eee;
        padding-bottom: 20px;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 105, 92, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 105, 92, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 105, 92, 0);
    }
}

.cta-pulse {
    animation: pulse 2s infinite;
}

/* =========================================
   New Responsive Styles (Mobile Fixes)
   ========================================= */

/* Hero Section */
.hero-section {
    padding: 60px 20px;
    border-bottom: 2px solid var(--border-color);
}

.hero-title {
    color: var(--primary-red);
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 40px;
    color: #555;
}

.login-prompt {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.login-heading {
    font-size: 1.2rem;
}

.login-note {
    font-size: 0.9rem;
    color: #777;
}

/* Collection Grid */
.collections-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.collection-card {
    width: 250px;
    height: 150px;
    background: #333;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.2rem;
    text-transform: uppercase;
    transition: transform 0.2s, background-color 0.2s;
}

.collection-card:hover {
    background: var(--primary-red) !important;
    transform: scale(1.05);
}

/* Media Queries for Mobile Screens */
@media (max-width: 600px) {
    .hero-title {
        font-size: 2rem;
        /* Significantly smaller */
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-section {
        padding: 40px 15px;
        /* Less padding */
    }

    /* Stack collection cards properly if needed, but flex-wrap handles it. 
       Just ensure they don't overflow if screen < 250px (unlikely) */
    .collection-card {
        width: 100%;
        /* Take full width on very small screens */
        max-width: 280px;
    }

    .login-prompt {
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
    }
}