:root {
    --primary-brown: #8B6F47;
    --secondary-brown: #A0826D;
    --dark-brown: #5D4E37;
    --light-beige: #F5E6D3;
    --cream: #FAF0E6;
    --terracotta: #C65D00;
    --sage-green: #87A96B;
    --stone-gray: #918E85;
    --white: #FFFFFF;
    --black: #2C2416;
    --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--cream);
    color: var(--black);
    line-height: 1.6;
}

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

/* Header */
header {
    background: linear-gradient(135deg, var(--dark-brown) 0%, var(--primary-brown) 100%);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px var(--shadow);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    color: var(--light-beige);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--light-beige);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

nav a:hover {
    color: var(--white);
}

.user-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.user-actions a {
    color: var(--light-beige);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.user-actions a:hover {
    color: var(--white);
}

.cart-count {
    background: var(--terracotta);
    color: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-left: 5px;
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.page-title {
    color: var(--dark-brown);
    margin-bottom: 2rem;
    font-size: 2.5rem;
    text-align: center;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 20px var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.product-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    background: var(--light-beige);
    height: 250px;
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: contain;
    background: var(--light-beige);
    transition: all 0.3s ease;
    cursor: zoom-in;
}

.product-image-container:hover .product-image {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: 90vh;
    max-width: 90vw;
    z-index: 9999;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* Main product image hover zoom on detail page */
.main-image {
    cursor: zoom-in;
    transition: all 0.3s ease;
}

.main-image:hover {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: 90vh;
    max-width: 90vw;
    z-index: 9999;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.2rem;
    color: var(--dark-brown);
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.5rem;
    color: var(--primary-brown);
    font-weight: bold;
    margin-bottom: 1rem;
}

.product-description {
    color: var(--stone-gray);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-brown);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background: var(--dark-brown);
}

.btn-secondary {
    background: var(--secondary-brown);
}

.btn-secondary:hover {
    background: var(--primary-brown);
}

.btn-success {
    background: var(--sage-green);
}

.btn-success:hover {
    background: #6B8E4F;
}

.btn-danger {
    background: var(--terracotta);
}

.btn-danger:hover {
    background: #A54D00;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-brown);
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--stone-gray);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: var(--white);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-brown);
}

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

/* Tables */
.table {
    width: 100%;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow);
}

.table th {
    background: var(--primary-brown);
    color: var(--white);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

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

.table tr:hover {
    background: var(--cream);
}

/* Footer */
footer {
    background: var(--dark-brown);
    color: var(--light-beige);
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: var(--light-beige);
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom a {
    color: var(--secondary-brown);
    text-decoration: none;
    font-weight: bold;
}

.footer-bottom a:hover {
    color: var(--light-beige);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(93, 78, 55, 0.8), rgba(139, 111, 71, 0.8)),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%23F5E6D3"/><path fill="%238B6F47" d="M0 300L50 325L100 300L150 275L200 300L250 325L300 300L350 275L400 300L450 325L500 300L550 275L600 300L650 325L700 300L750 275L800 300L850 325L900 300L950 275L1000 300L1050 325L1100 300L1150 275L1200 300V600H0V300Z"/></svg>');
    background-size: cover;
    background-position: center;
    padding: 4rem 0;
    text-align: center;
    color: var(--white);
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--light-beige);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(135, 169, 107, 0.2);
    border: 1px solid var(--sage-green);
    color: #4A5F3E;
}

.alert-error {
    background: rgba(198, 93, 0, 0.2);
    border: 1px solid var(--terracotta);
    color: #8B4000;
}

.alert-info {
    background: rgba(160, 130, 109, 0.2);
    border: 1px solid var(--secondary-brown);
    color: var(--dark-brown);
}

/* Admin Panel */
.admin-sidebar {
    background: var(--dark-brown);
    color: var(--light-beige);
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

.admin-sidebar h3 {
    color: var(--white);
    margin-bottom: 1.5rem;
}

.admin-menu {
    list-style: none;
}

.admin-menu a {
    color: var(--light-beige);
    text-decoration: none;
    display: block;
    padding: 0.75rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.admin-menu a:hover,
.admin-menu a.active {
    background: var(--primary-brown);
    color: var(--white);
}

.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-main {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

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

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        min-height: auto;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}