:root {
    --primary-color: #ffd700;
    /* Richer Gold */
    --primary-hover: #e6c200;
    --secondary-color: #1a2a3a;
    /* Deeper Dark Blue */
    --accent-color: #ff4757;
    --background-color: #f4f7f6;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-color: #2f3542;
    --text-muted: #57606f;
    --border-color: #e1e8ed;
    --radius: 16px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.12);
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--background-color);
    background-image: radial-gradient(var(--border-color) 0.5px, transparent 0.5px);
    background-size: 20px 20px;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
/* Header */
.main-header {
    background: var(--secondary-color);
    border-bottom: 3px solid var(--primary-color);
    padding: 1.5rem 0;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-md);
    color: white;
    position: sticky;
    top: 0;
    z-index: 900;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.nav-link {
    text-decoration: none;
    color: #fff;
    /* White text for contrast */
    margin-right: 1.5rem;
    font-weight: 700;
    /* Bold as requested */
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary-color);
    background-color: var(--primary-color);
    /* Gold background on hover */
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

/* Filter Section */
.filter-section {
    margin-bottom: 2rem;
    text-align: center;
}

.filter-section h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.categories {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 2px solid var(--border-color);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    color: var(--text-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-sm);
}

.filter-btn.active {
    background: var(--primary-color);
    color: var(--secondary-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding-bottom: 3rem;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #eee;
}

.product-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.875rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.product-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: auto;
    color: var(--text-color);
}

/* Footer */
.main-footer {
    background: var(--secondary-color);
    padding: 4rem 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5rem;
    border-top: 5px solid var(--primary-color);
}

/* Product Details Page */
.product-details-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .product-details-container {
        grid-template-columns: 1fr;
    }
}

.detail-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    object-fit: cover;
    max-height: 500px;
}

.detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Push button to bottom */
}

.detail-category {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.detail-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.detail-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.detail-actions .btn {
    flex: 1;
    /* Make buttons equal width */
    justify-content: center;
    padding: 0.8rem 1.5rem;
}

.back-btn {
    /* Styles now handled by .btn and .btn-secondary, just ensuring specific tweaks if needed */
    text-decoration: none;
    display: inline-flex;
    /* Fix for anchor tag behaving like button */
}

/* Admin Styles */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    /* Wider padding for oval look */
    border: 2px solid transparent;
    /* Prepare for outline */
    border-radius: 50px;
    /* Oval Shape */
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Subtle inner border */
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    filter: brightness(1.1);
}

/* Outline style capability if needed, or specific outline buttons */
.btn-outline {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(44, 62, 80, 0.2);
}

.btn-secondary:hover {
    background-color: #1a252f;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(44, 62, 80, 0.3);
}

.btn-danger {
    background: #ef4444;
    /* Explicit red */
    color: white;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
    border: 1px solid #dc2626;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.4);
}

.btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.table-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background-color: #f1f5f9;
    font-weight: 700;
}

.admin-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 2.5rem;
    border-radius: 24px;
    width: 90%;
    max-width: 550px;
    position: relative;
    box-shadow: var(--shadow-lg);
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    width: 30px;
    height: 30px;
    background: #f1f1f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #ff4d4d;
    color: white;
    transform: rotate(90deg);
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 0.95rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #eee;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
}

/* Cart Styles */
.cart-icon {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background-color: var(--primary-color);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: transform 0.2s;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ef4444;
    color: white;
    font-size: 0.75rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-info h4 {
    margin-bottom: 0.25rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cart-modal-content {
    max-width: 600px;
    background-color: #ffffff;
    /* User requested specific white background */
    color: #333;
    border-radius: 20px;
    /* Nicer rounded corners */
}

.cart-item {
    background: #f8f9fa;
    /* Slight off-white for items to stand out against white modal */
    border-radius: 8px;
    margin-bottom: 0.5rem;
    padding: 1rem;
    border: 1px solid #eee;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Badge */
.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .main-header .container {
        flex-direction: column;
        gap: 1rem;
    }


    .logo {
        font-size: 1.2rem;
    }
}

/* Bulk Actions Styles */
.bulk-actions-bar {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selected-row {
    background-color: rgba(212, 175, 55, 0.1) !important;
}

.admin-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

@media (max-width: 600px) {
    .bulk-actions-bar {
        width: 100%;
        justify-content: space-between;
    }
}