:root {
    --orange: #f36240;
    --mint: #40c4aa;
    --bg-light: #fdfaf6;
    --text-dark: #333;
    --white: #ffffff;
    --border: #ece6df;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --danger: #d9534f;
    --success: #2e9f6b;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
textarea {
    font: inherit;
}

.navbar {
    background: var(--white);
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 120px;
    text-decoration: none;
}

.logo {
    height: 50px;
    width: auto;
}

.header-banner {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 62px;
    overflow: hidden;
}

.header-banner img {
    height: 100%;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
}

nav {
    display: flex;
    gap: 14px;
    align-items: center;
    min-width: 320px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--orange);
}

.nav-link {
    padding: 8px 0;
}

.admin-btn,
.secondary-btn,
.inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.admin-btn {
    background: var(--mint);
    color: var(--white) !important;
    padding: 10px 18px;
    border-radius: 25px;
    transition: opacity 0.3s;
}

.admin-btn:hover {
    opacity: 0.92;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px 30px;
}

.narrow-container {
    max-width: 960px;
}

.hero-box,
.panel-box {
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.hero-box {
    margin-bottom: 35px;
    border: 1px solid rgba(243, 98, 64, 0.08);
}

.hero-box h1,
.section-title {
    color: var(--orange);
}

.hero-box h1 {
    margin: 0 0 8px;
    font-size: 2rem;
}

.hero-box p {
    margin: 0;
    color: #555;
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
}

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

.product-card {
    background: var(--white);
    border-radius: 15px;
    padding: 18px;
    text-align: left;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(0,0,0,0.04);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.product-img-box {
    margin-bottom: 15px;
}

.product-img-box img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
}

.product-card h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.product-card .product-desc {
    color: #666;
    min-height: 48px;
    margin: 0 0 8px;
}

.price {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--orange);
    margin: 10px 0;
}

.buy-btn,
.secondary-btn {
    padding: 12px 16px;
    border-radius: 25px;
    font-weight: bold;
    transition: 0.25s ease;
}

.buy-btn {
    background: var(--orange);
    color: var(--white);
    width: 100%;
    border: none;
}

.buy-btn:hover {
    background: #e25230;
}

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

.secondary-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.cart-badge {
    background: var(--orange);
    color: var(--white);
    border-radius: 999px;
    padding: 2px 8px;
    margin-left: 4px;
    font-size: 0.85rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    margin: 3% auto;
    padding: 30px;
    width: 100%;
    max-width: 950px;
    border-radius: 20px;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.product-modal-content {
    max-width: 1000px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-body {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.modal-gallery-preview,
.modal-info {
    flex: 1;
}

.modal-main-image-wrapper {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #f7f3ee;
}

.modal-main-img {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    cursor: zoom-in;
}

.thumbnail-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.thumbnail-row img {
    width: 74px;
    height: 74px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
}

.thumbnail-row img.active {
    border-color: var(--orange);
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.85);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1.2rem;
}

.gallery-arrow.left {
    left: 12px;
}

.gallery-arrow.right {
    right: 12px;
}

.modal-description {
    white-space: pre-line;
    color: #555;
}

.modal-actions {
    margin-top: 18px;
}

.close-modal {
    position: absolute;
    right: 18px;
    top: 12px;
    font-size: 36px;
    cursor: pointer;
    color: #999;
    background: transparent;
    border: none;
}

.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#lightbox-img {
    max-width: 95%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.close-lightbox {
    position: absolute;
    top: 25px;
    right: 35px;
    color: var(--white);
    font-size: 50px;
    cursor: pointer;
    font-weight: bold;
    background: transparent;
    border: none;
}

.lightbox-nav {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    pointer-events: none;
}

.nav-btn {
    pointer-events: auto;
    background: rgba(255,255,255,0.12);
    color: var(--white);
    border: none;
    font-size: 40px;
    padding: 18px;
    cursor: pointer;
    border-radius: 50%;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
}

.checkout-form,
.admin-form,
#admin-login-form {
    display: grid;
    gap: 12px;
}

label {
    font-weight: 700;
    margin-top: 6px;
}

input,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d7d1ca;
    border-radius: 12px;
    background: #fff;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.small-note {
    margin: 6px 0 12px;
    color: #666;
    font-size: 0.95rem;
}

.summary-box {
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.summary-line,
.cart-row,
.checkout-row,
.admin-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.cart-row,
.checkout-row,
.admin-row {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.cart-row-title,
.checkout-row-title {
    font-weight: 700;
}

.cart-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 20px;
    flex-wrap: wrap;
}

.inline-btn {
    width: auto;
    min-width: 220px;
}

.admin-page {
    max-width: 1100px;
}

.auth-box {
    max-width: 480px;
    margin: 40px auto;
}

.dashboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 24px;
}

.admin-product-list {
    display: grid;
    gap: 14px;
}

.admin-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    background: #fffdfa;
}

.admin-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.admin-card h3 {
    margin: 0 0 6px;
}

.admin-images-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.admin-images-preview img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
}

.status-box {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eefaf4;
    color: var(--success);
    font-weight: 700;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #222;
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: 0.25s ease;
    z-index: 12000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.empty-state {
    background: var(--white);
    border-radius: 18px;
    padding: 28px;
    box-shadow: var(--shadow);
    text-align: center;
}

.hidden {
    display: none !important;
}

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

.top-margin {
    margin-top: 20px;
}

@media (max-width: 900px) {
    .header-banner {
        display: none;
    }

    .modal-body,
    .checkout-layout {
        grid-template-columns: 1fr;
        display: grid;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
    }

    nav {
        justify-content: center;
        min-width: auto;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 14px 24px;
    }

    .hero-box h1,
    .section-title {
        font-size: 1.6rem;
    }

    .modal-content {
        padding: 18px;
    }

    .cart-actions,
    .dashboard-head,
    .admin-card-head,
    .summary-line,
    .cart-row,
    .checkout-row,
    .admin-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .inline-btn,
    .secondary-btn,
    .buy-btn {
        width: 100%;
    }
}
