/* Design System */
:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --primary: #d4af37;
    /* Gold */
    --primary-hover: #b5952f;
    --border: #333333;
    --glass: rgba(30, 30, 30, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: 'Playfair Display', serif;
    color: var(--text-main);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    height: 50px;
    width: auto;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.brand-name small {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--primary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    position: relative;
    padding: 8px;
    transition: color 0.3s;
}

.icon-btn:hover {
    color: var(--primary);
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: var(--bg-dark);
    font-size: 0.7rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero {
    height: 80vh;
    background: url('https://images.unsplash.com/photo-1497935586351-b67a49e012bf?q=80&w=2071') no-repeat center center/cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero h2 {
    font-size: 4rem;
    margin-bottom: 20px;
}

.gold-text {
    color: var(--primary);
    font-style: italic;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Menu Section */
.menu-section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h3 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card.unavailable {
    filter: grayscale(100%);
    opacity: 0.7;
}

.product-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 20px;
}

.product-cat {
    font-size: 0.8rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-title {
    font-size: 1.2rem;
    margin: 10px 0;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.product-price {
    font-weight: 600;
    color: var(--text-main);
}

.variant-select {
    background: var(--bg-dark);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 5px;
    font-size: 0.9rem;
    max-width: 120px;
    margin-right: 10px;
}

.add-btn {
    background: var(--border);
    color: var(--text-main);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.add-btn:hover:not(.disabled) {
    background: var(--primary);
    color: var(--bg-dark);
}

.add-btn.disabled {
    cursor: not-allowed;
    background: #333;
    color: #555;
    font-size: 0.8rem;
    width: auto;
    padding: 0 10px;
    border-radius: 4px;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: var(--bg-card);
    z-index: 2000;
    transition: right 0.3s ease;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
}

.cart-sidebar.open {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: none;
    backdrop-filter: blur(2px);
}

.cart-overlay.open {
    display: block;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
}

.empty-msg {
    text-align: center;
    color: var(--text-muted);
    margin-top: 50px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.cart-item-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 1rem;
    margin-bottom: 4px;
}

.cart-item-variant {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.cart-item-price {
    font-weight: 600;
    color: var(--primary);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.qty-btn {
    background: var(--border);
    color: var(--text-main);
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    border: none;
}

.cart-footer {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.full-width {
    width: 100%;
    text-align: center;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal System */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
}

.form-group input:focus {
    border-color: var(--primary);
    outline: none;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 50px;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: #ff4444;
    color: #ff4444;
}

/* Responsive & Mobile Optimization */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }

    .container {
        padding: 0 15px;
    }

    /* Header adjustments */
    .logo-img {
        height: 40px;
    }

    .brand-name {
        font-size: 0.9rem;
        line-height: 1.1;
    }

    .brand-name small {
        font-size: 0.6rem;
    }

    /* Hero adjustments */
    .hero h2 {
        font-size: 2.5rem;
        padding: 0 10px;
    }

    .hero p {
        font-size: 1rem;
        padding: 0 20px;
    }

    /* Filter buttons - Horizontal Scroll */
    .filter-buttons {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .filter-btn {
        white-space: nowrap;
        font-size: 0.9rem;
        padding: 6px 16px;
    }

    /* Hide scrollbar for filters */
    .filter-buttons::-webkit-scrollbar {
        height: 4px;
    }

    .filter-buttons::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 4px;
    }

    /* Product Grid - 2 Columns on Mobile */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product-img {
        height: 150px;
    }

    .product-info {
        padding: 12px;
    }

    .product-title {
        font-size: 1rem;
        margin-bottom: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .product-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .variant-select {
        width: 100%;
        max-width: none;
        margin-right: 0;
        margin-bottom: 5px;
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .add-btn {
        width: 100%;
        border-radius: 8px;
        height: 32px;
    }

    /* Cart Sidebar */
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* Small Mobile Devices */
@media (max-width: 380px) {
    .brand-name {
        display: none;
        /* Hide text on very small screens if needed, or scale down further */
    }

    .logo::after {
        content: "The Coffee Theory";
        font-family: 'Playfair Display', serif;
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-main);
    }
}

/* Product Management Styles */
.large-modal {
    max-width: 800px;
}

.product-manager-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.pm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    padding: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.pm-item:last-child {
    border-bottom: none;
}

.pm-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.pm-img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
}

.pm-details h4 {
    margin: 0 0 5px;
    font-size: 1rem;
}

.pm-details p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.pm-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-danger {
    color: #ff4444;
    border-color: #ff4444;
}

.btn-danger:hover {
    background: #ff4444;
    color: white;
}

.variant-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.variant-row input {
    width: 100%;
}