/* Evo E-commerce - Main Stylesheet */
/* v2.3.0 - Consolidated all common HTML inline CSS into this stylesheet. */
/* v2.3.1 - Enhanced modal styles, added new keyframes, refined product card/details and category image fitting, improved responsive handling. */
/* v2.4.0 - User requested changes: Category grid layout, gold stars, reduced product name font-size, enhanced loading UI. */

/* --- 1. Global Styles & Variables --- */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}
:root {
    --primary-color: #0d6efd;
    --primary-color-dark: #0a58ca; /* Darker shade for hover effects */
    --primary-color-light: #a7d9ff; /* Light shade for hover effects on borders etc. */
    --secondary-color: #6c757d;
    --dark-color: #000000;
    --light-color: #ffffff;
    --success-color: #198754;
    --danger-color: #dc3545;
    --background-color: #f4f7f6;
    --font-family: 'Inter', sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    margin: 0;
    background-color: var(--background-color);
    color: var(--dark-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0; /* Ensuring consistent padding */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color-dark); /* Using variable */
}

h1, h2, h3 {
    color: var(--dark-color);
    margin-bottom: 20px;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Utility Classes --- */
.hidden {
    display: none !important;
}
.text-red-500 { color: var(--danger-color); }
.text-green-500 { color: var(--success-color); }
.text-sm { font-size: 0.875em; }
.mb-3 { margin-bottom: 0.75rem; } /* Tailwind equivalent, can be adjusted */

/* Buttons (Consolidated) */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
.btn-primary:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}
/* You had btn-secondary, btn-danger etc. in account.html's style. Keep those if used specifically. */
.btn-secondary { background-color: var(--secondary-color); color: white; padding: 8px 15px; border: none; border-radius: 5px; cursor: pointer; }
.btn-danger { background-color: var(--danger-color); color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; }


/* Form Group Styles (Consolidated & Refined) */
.form-group {
    margin-bottom: 15px; /* Default margin for all form groups */
}
.form-group label {
    display: block;
    margin-bottom: 5px; /* Default margin below labels */
    font-weight: bold;
    color: #444;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea,
.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-group input[type="file"] {
    padding: 8px; /* Slightly less padding for file input */
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-group input[type="file"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.3);
}
/* For inputs with number spinners */
.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.form-group input[type="number"] {
    -moz-appearance: textfield; /* Firefox spinner hide */
}


/* --- 2. Header & Navigation (Consolidated) --- */
header {
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease-in-out;
}

.navbar {
    display: flex;
    justify-content: flex-start; /* This is the main change */
    align-items: center;
    padding: 1rem 0;
    gap: 2rem; /* Adds space between logo, search, and nav icons */
}

.logo {
    font-size: 2.2em;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}
.logo:hover {
    color: var(--primary-color-dark);
}

.search-container {
    flex-grow: 1; /* Allows the search bar to fill space */
    max-width: 700px;
    position: relative;
    margin: 0 auto; /* This centers the search bar in the available space */
}

.search-bar {
    display: flex;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.search-bar input {
    flex-grow: 1;
    border: none;
    padding: 10px 15px;
    font-size: 1em;
    outline: none;
    background-color: #fcfcfc;
}

.search-bar button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.search-bar button:hover {
    background-color: var(--primary-color-dark);
    transform: scale(1.05);
}
.search-bar button:active {
    transform: scale(0.95);
}

.nav-icons {
    display: flex;
    align-items: center;
    margin-left: auto; /* This pushes the icons to the far right */
}

.nav-icons a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-icons a:hover {
    color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
}

/* Cart Icon Specifics */
.cart-icon {
    position: relative;
}

#cartCount {
    background-color: var(--danger-color);
    color: white;
    font-size: 0.75em;
    padding: 3px 7px;
    border-radius: 50%;
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    text-align: center;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.cart-icon:hover #cartCount {
    transform: scale(1.1);
}

/* Live Search Results Styles (Consolidated) */
.search-results-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    z-index: 999;
    max-height: 400px;
    overflow-y: auto;
}

.search-results-container.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--dark-color);
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: var(--border-radius);
}

.search-result-info {
    display: flex;
    flex-direction: column;
}

.search-result-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-price {
    font-size: 0.9em;
    color: var(--secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--secondary-color);
}

/* --- 3. Homepage & Category Page Styles (Consolidated) --- */
/* Hero Section */
.hero-section {
    background-image: url('https://images.unsplash.com/photo-1554679619-bc78b12f4ac6?fit=crop&w=1400&q=80');
    background-size: cover;
    background-position: center;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    transition: background-image 1s ease-in-out;
}

/* Overlay for better text readability */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: none; /* <<< MODIFIED: Removes the overlay */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    animation: slideInUp 1s ease-out;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-content h1 {
    font-size: 4.5em;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
}

.hero-content p {
    font-size: 1.8em;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInText 1.5s ease-out 0.5s forwards;
    opacity: 0;
}
/* Keyframes for hero content animations */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInText {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* Categories Section */
.categories {
    padding: 50px 0;
    text-align: center;
}

.categories h2, .products h2#categoryTitle {
    text-align: center;
    font-size: 2.5em;
    color: #212529;
    margin-bottom: 40px;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
    display: inline-block;
    width: 100%;
}

.categories h2::after, .products h2#categoryTitle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 5px;
}

/* MODIFIED: Category Grid Layout for 2 columns on most screens */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    padding: 0 20px;
}

/* Adjusted for 2 columns per row on larger screens too, as requested by screenshot */
@media (min-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr); /* Two columns on larger screens too */
        max-width: 500px; /* Constrain grid width to make two columns more compact */
        margin: 0 auto; /* Center the grid */
    }
}
/* --- Responsive Adjustment: Popular Categories to Four Columns on PC (New) --- */

@media (min-width: 1024px) { /* Applies to large desktops and laptops */
    .category-grid {
        grid-template-columns: repeat(4, 1fr) !important; /* Force four equal columns */
        max-width: 1200px !important; /* Allow it to span wider for 4 columns */
        gap: 30px !important; /* Adjust gap for wider layout */
    }
}


/* Individual Category Card */
.category-card {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    transition: all 0.3s ease-in-out;
    border: 1px solid #e0e0e0;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    background-color: #fdfdfd;
}

.category-card img {
    width: 100%;
    height: 150px;
    /* FIX FOR FURNITURE IMAGE: Change from cover to contain */
    object-fit: contain; /* Changed from 'cover' to 'contain' */
    background-color: #f0f0f0; /* Added background for 'contain' */
    border-radius: 8px;
    margin-bottom: 15px;
    transition: transform 0.4s ease-out;
}
.category-card:hover img {
    transform: scale(1.05);
}
.category-card h3 {
    font-size: 1.3em;
    font-weight: 600;
    color: #212529;
    margin: 0; /* Adjusted margin */
    padding: 0; /* Adjusted padding */
}


/* Products List View (Category Page & Search Results) */
.product-list-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    max-width: 100%;
    margin: 0 auto;
}

.product-card {
    background-color: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: var(--dark-color);
    display: flex;
    flex-direction: column;
    transition: all 0.4s ease-in-out;
    position: relative;
    border: 1px solid #eee;

    /* Starting state for loading animation */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out,
                transform 0.4s ease-out,
                box-shadow 0.4s ease-out;
}

/* Class added by JavaScript to make the card appear */
.product-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hover effect */
.product-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    background-color: #fdfdfd;
}

.product-card-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
}

.product-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease-out;
    border-radius: 15px 15px 0 0;
}

.product-card:hover .product-card-image-wrapper img {
    transform: scale(1.05);
}

/* Product Card Info */
.product-card-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* MODIFIED: Product Name for single line */
.product-name {
    font-size: 1.1em; /* Reduced from 1.3em */
    font-weight: 600;
    color: #212529;
    margin-bottom: 5px;
    line-height: 1.2; /* Adjusted line height */
    white-space: nowrap; /* Ensure text stays on one line */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for overflow */
}

.product-category {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 8px;
}
@media (max-width: 767px) {
  .product-card .product-price {
    font-size: 0.80em !important;
  }
}
.product-price {
    font-size: 0.80em;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: auto;
    text-align: right;
}

/* MODIFIED: Product Rating Stars to Gold */
.product-rating .stars i {
    color: #FFD700; /* Gold color for stars */
}

/* Product Card Overlay/Actions */
.product-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    opacity: 0;
}

.product-card:hover .product-card-overlay {
    transform: translateY(0);
    opacity: 1;
}

.overlay-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.overlay-button:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}
.overlay-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}

/* Category Filter & Sort Styles */
.filter-sort-container {
    background-color: #ffffff;
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
    margin-bottom: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.filter-group, .sort-group {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
}

.filter-group label, .sort-group label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.filter-sort-container input[type="number"],
.filter-sort-container select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background-color: #fcfcfc;
    -moz-appearance: textfield;
    appearance: textfield;
}

.filter-sort-container input[type="number"]::-webkit-outer-spin-button,
.filter-sort-container input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-sort-container input[type="number"]:focus,
.filter-sort-container select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2);
}

#filter-apply-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
    flex-shrink: 0;
    align-self: flex-end;
}

#filter-apply-btn:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
}
#filter-apply-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}


/* --- 4. Product Details Page (Consolidated) --- */
.product-details-container {
    max-width: 1000px;
    margin: 80px auto 50px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.8s ease-out;
}

.product-details-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: flex-start;
}

.product-image-section {
    text-align: center;
}
.product-image-section img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    object-fit: contain;
    background-color: #f9f9f9;
}
.product-image-section img:hover {
    transform: scale(1.02);
}

.product-info-section h1 {
    font-size: 2.8em;
    color: #212529;
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
}
.product-info-section h1::after { display: none; }

.product-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.95em;
    color: #777;
}
.category-display {
    background-color: #e9ecef;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: 500;
}
/* MODIFIED: Product Meta Stars to Gold */
.product-meta .star-rating i {
    color: #FFD700;
}

.product-rating-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #555;
}
/* MODIFIED: Product Rating Summary Stars to Gold */
.product-rating-summary .star-rating i {
    color: #FFD700;
}

.description {
    font-size: 1.05em;
    color: #495057;
    line-height: 1.7;
    margin-bottom: 25px;
    /* FIX FOR STRETCHED TEXT ON PRODUCT DETAILS PAGE */
    word-wrap: break-word; /* Ensures long words break and wrap */
    word-break: break-word; /* Allows breaking of words */
}

.price-section {
    font-size: 2.5em;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.color-options-section, .variants-section {
    margin-bottom: 25px;
}
.color-options-section h3, .variants-section h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    text-align: left;
}
.color-options-section h3::after, .variants-section h3::after { display: none; }


.color-swatch-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.color-swatch-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
.color-swatch-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.color-swatch-item.selected {
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}
.color-swatch-item.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: white;
    font-size: 1.2em;
    text-shadow: 0 0 5px rgba(0,0,0,0.7);
}

.variants-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.variant-option {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-grow: 1;
    min-width: 150px;
    justify-content: space-between;
}
.variant-option:hover {
    border-color: var(--primary-color-light);
    background-color: #eff5ff;
}
.variant-option input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
    display: none;
}
.variant-option input[type="radio"]:checked + .variant-info {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: #f0f8ff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.2);
}
.variant-option input[type="radio"]:checked + .variant-info .variant-stock {
    color: var(--primary-color-dark);
}
.variant-option input[type="radio"]:disabled + .variant-info {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #eee;
    background-color: #f8f8f8;
}
.variant-option input[type="radio"]:disabled {
    cursor: not-allowed;
}

.variant-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: flex-start;
    gap: 5px;
}
.variant-other-specs {
    font-weight: 600;
    color: #333;
    font-size: 1em;
}
.variant-price {
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
}
.variant-stock {
    font-size: 0.8em;
    margin-top: 5px;
}

.quantity-add-section {
    display: flex;
    align-items: center;
    gap: 10px;
}
.quantity-add-section input[type="number"] {
    width: 70px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 1.1em;
    -moz-appearance: textfield;
}
.quantity-add-section input[type="number"]::-webkit-outer-spin-button,
.quantity-add-section input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.quantity-add-section input[type="number"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.add-to-cart-button {
    background-color: var(--success-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.add-to-cart-button:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4);
}
.add-to-cart-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.2);
}
.add-to-cart-button.btn-disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.add-to-cart-button.btn-disabled:hover {
    background-color: #cccccc;
    transform: none;
    box-shadow: none;
}

/* Reviews Section */
.reviews-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}
.reviews-section h2 {
    font-size: 2em;
    color: #212529;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}
.reviews-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 5px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}
.review-item {
    background-color: #fdfdfd;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.04);
    border: 1px solid #eee;
    transition: all 0.2s ease;
}
.review-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}
.review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.95em;
    color: #666;
    flex-wrap: wrap;
}
.review-user {
    font-weight: bold;
    color: #333;
}
/* MODIFIED: Review Item Stars to Gold */
.review-header .star-rating i {
    color: #FFD700;
}
.review-comment {
    font-size: 1em;
    color: #495057;
    line-height: 1.6;
    margin-bottom: 10px;
}
.review-image {
    max-width: 150px;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#writeReviewHeading {
    font-size: 1.8em;
    color: #212529;
    margin-top: 40px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}
#writeReviewHeading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 5px;
}

#reviewFormContainer {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    margin-bottom: 50px;
}
#reviewFormContainer .form-group {
    margin-bottom: 20px;
}
#reviewFormContainer label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 1.05em;
}
#reviewFormContainer .star-rating-input {
    font-size: 1.8em;
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}
/* MODIFIED: Review Form Stars to Gold */
#reviewFormContainer .star-rating-input i {
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.1s ease;
}
#reviewFormContainer .star-rating-input i.fas {
    color: #FFD700;
}
#reviewFormContainer .star-rating-input i:hover {
    transform: scale(1.1);
}

#reviewFormContainer textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#reviewFormContainer textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2);
}
#reviewFormContainer input[type="file"] {
    padding: 8px 0;
}
#reviewFormContainer .image-preview {
    width: 120px;
    height: 120px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9em;
    color: #999;
    overflow: hidden;
    margin-top: 10px;
}
#reviewFormContainer .image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#reviewFormContainer .btn-primary {
    margin-top: 20px;
    width: auto;
    padding: 10px 25px;
    font-size: 1.1em;
}

/* MODIFIED: Loading Message for premium look */
.loading-message {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 0; /* More vertical padding */
    grid-column: 1 / -1; /* Span across grid columns */
    text-align: center;
    color: var(--primary-color-dark); /* Darker primary color */
    background-color: #e6f7ff; /* Light blue background */
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.1); /* Subtle shadow */
    margin: 20px auto; /* Center the loading message */
    max-width: 400px; /* Constrain width */
    width: 100%; /* Ensure it takes full width within max-width */
    animation: fadeIn 0.6s ease-out; /* Fade in animation */
}

.loading-message p {
    margin-top: 20px; /* More space above text */
    font-weight: 600;
    font-size: 1.2em; /* Slightly larger text */
    color: #333;
}

/* MODIFIED: Spinner for premium look */
.spinner {
    border: 6px solid var(--primary-color-light); /* Lighter primary color for border */
    border-top-color: var(--primary-color); /* Primary color for spinning part */
    width: 50px; /* Larger spinner */
    height: 50px; /* Larger spinner */
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite; /* More dynamic spin animation */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- 5. Cart & Checkout Pages (Consolidated) --- */
/* Cart Page Container */
.cart-page-container {
    max-width: 960px;
    margin: 80px auto 50px auto;
    padding: 35px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.8s ease-out;
    /* display: none; /* Controlled by inline script on cart.html */
}

.cart-page-container h1 {
    text-align: center;
    color: #212529;
    margin-bottom: 40px;
    font-size: 2.8em;
    position: relative;
    padding-bottom: 15px;
    font-weight: 700;
}

.cart-page-container h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 5一遍;
}

/* Cart Items List */
.cart-items-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background-color: #fdfdfd;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.cart-item:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: contain; /* <-- THIS IS THE FIX */
    border-radius: 8px;
    border: 1px solid #eee;
    flex-shrink: 0;
    background-color: #f8fafc; /* Optional: Adds a light grey background */
}

.cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cart-item-details h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 5px;
    font-weight: 600;
}

.cart-item-details p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 3px;
}

.cart-item-price {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-left: 20px;
    text-align: right;
    min-width: 100px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    margin-left: auto;
}

.quantity-control button {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    color: #555;
    transition: all 0.2s ease;
}

.quantity-control button:hover {
    background-color: #e0e0e0;
    color: #222;
    transform: scale(1.05);
}
.quantity-control button:active {
    transform: scale(0.95);
}

.item-quantity-input {
    width: 50px;
    padding: 8px 5px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 1em;
    -moz-appearance: textfield;
    outline: none;
    transition: border-color 0.2s;
}

.item-quantity-input::-webkit-outer-spin-button,
.item-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.item-quantity-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.remove-item-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 15px;
    padding: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.remove-item-btn:hover {
    color: #c82333;
    transform: scale(1.1);
    background-color: rgba(220, 53, 69, 0.1);
}
.remove-item-btn:active {
    transform: scale(0.9);
}

/* Cart Summary Styles */
.cart-summary {
    background-color: #fcfcfc;
    border-radius: 10px;
    padding: 25px;
    margin-top: 30px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 1.1em;
    color: #555;
    border-bottom: 1px dashed #eee;
}

.summary-row:last-of-type {
    border-bottom: none;
    font-size: 1.4em;
    font-weight: 700;
    color: #212529;
    padding-top: 15px;
}

.summary-row span:first-child {
    font-weight: 500;
}
.summary-row.total span:first-child {
    font-weight: 700;
}

/* Checkout Button */
.checkout-button-container {
    text-align: right;
    margin-top: 30px;
}

.checkout-button {
    display: inline-block;
    background-color: var(--success-color);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    letter-spacing: 0.5px;
}

.checkout-button:hover {
    background-color: #218838;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
}
.checkout-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.3);
}


/* Checkout Page Specific Styles */
.checkout-page-container {
    max-width: 1000px;
    margin: 80px auto 50px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.8s ease-out;
}

.checkout-page-container h1 {
    text-align: center;
    color: #212529;
    margin-bottom: 40px;
    font-size: 2.8em;
    position: relative;
    padding-bottom: 15px;
    font-weight: 700;
}

.checkout-page-container h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 5px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: flex-start;
}

.checkout-form-section, .order-summary-section {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.checkout-form-section h2,
.order-summary-section h2 {
    font-size: 1.8em;
    color: #212529;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    font-weight: 600;
}

.payment-methods-selection {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.payment-option-radio {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-grow: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.payment-option-radio:hover {
    border-color: var(--primary-color-light);
    background-color: #eff5ff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}
.payment-option-radio input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
}
.payment-option-radio label {
    font-weight: 500;
    color: #333;
    cursor: pointer;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.payment-option-radio label i {
    font-size: 1.3em;
    color: #777;
}
.payment-option-radio input[type="radio"]:checked + label {
    color: var(--primary-color);
}
.payment-option-radio input[type="radio"]:checked + label i {
    color: var(--primary-color);
}
.payment-option-radio.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
    background-color: #eef2ff;
}

.payment-details-form {
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid #eee;
    margin-top: 15px;
}

.payment-details-form h3 {
    font-size: 1.3em;
    color: #444;
    margin-bottom: 20px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 10px;
}

/* Order Summary Section */
.order-summary-section {
    background-color: #fdfdfd;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.order-summary-items {
    max-height: 350px;
    overflow-y: auto;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #f0f0f0;
}

.summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.summary-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.summary-item-details {
    flex-grow: 1;
}

.summary-item-details h3 {
    font-size: 1em;
    margin: 0 0 5px;
    color: #333;
}

.summary-item-details p {
    font-size: 0.85em;
    color: #777;
    margin: 0;
}

.summary-item-total {
    font-weight: bold;
    color: var(--success-color);
    font-size: 1em;
}

.order-summary-total {
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-summary-total .summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1em;
    color: #555;
}

.order-summary-total .summary-row.total {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--dark-color);
    border-top: 2px solid var(--primary-color);
    padding-top: 15px;
    margin-top: 10px;
}

.place-order-button {
    display: block;
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 30px;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.place-order-button:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.4);
}
.place-order-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}


/* --- 6. Account Page (Consolidated) --- */
.account-page-container {
    max-width: 900px; /* Reduced max-width slightly for account page */
    margin: 80px auto 50px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.8s ease-out;
}

.account-page-container h1 {
    text-align: center;
    color: #212529;
    margin-bottom: 40px;
    font-size: 2.8em;
    position: relative;
    padding-bottom: 15px;
    font-weight: 700;
}
.account-page-container h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 5px;
}


.auth-form-container, .dashboard-section {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    margin-bottom: 20px;
    transition: all 0.3s ease-in-out;
}
.auth-form-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.auth-form-container h2, .dashboard-section h2 {
    font-size: 1.6em;
    color: #555;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    font-weight: 600;
}

.text-link {
    color: var(--primary-color);
    text-decoration: none;
    margin-top: 10px;
    display: block;
    text-align: center;
    cursor: pointer;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.text-link:hover {
    text-decoration: underline;
    color: var(--primary-color-dark);
}

.account-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 768px) {
    .account-dashboard {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

/* Dashboard Section Premium Look */
.dashboard-section {
    border: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.dashboard-section h2 {
    border-bottom: 2px solid var(--primary-color);
    color: #212529;
    font-weight: 600;
}

.profile-info p {
    margin-bottom: 8px;
    color: #495057;
}

.profile-info strong {
    color: #333;
}

.message-history {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #cce5ff;
    padding: 15px;
    border-radius: 8px;
    background-color: #e9f5ff;
    margin-bottom: 15px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.message-history:hover {
    border-color: #99ccff;
    box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.1);
}

.message-item {
    padding: 10px 0;
    border-bottom: 1px dashed #a8d6ff;
    transition: background-color 0.2s ease;
}
.message-item:hover {
    background-color: #e0f0ff;
}

.message-item:last-child {
    border-bottom: none;
}
.message-item .timestamp { font-size: 0.85em; color: #6c757d; }
.message-item .sender { font-weight: bold; color: #0056b3; }
.message-item .reply-sender { font-weight: bold; color: #157347; }
.message-item .content { margin-top: 5px; color: #343a40; line-height: 1.5; }
.no-messages-message { text-align: center; color: #888; font-style: italic; padding: 20px 0; background-color: #f8f9fa; border-radius: 5px; }

.order-history-list { display: flex; flex-direction: column; gap: 15px; }
.order-item {
    background-color: #fcfcfc;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease-in-out;
}
.order-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background-color: #ffffff;
}

.order-item h3 { font-size: 1.2em; color: #333; margin-bottom: 10px; }
.order-item p { font-size: 0.95em; margin-bottom: 5px; color: #555; }
.order-item strong { color: #333; }
.order-status { font-weight: bold; text-transform: capitalize; }
.order-status.pending { color: #ffc107; } .order-status.shipped { color: #17a2b8; } .order-status.delivered { color: #007bff; } .order-status.received { color: #28a745; } .order-status.cancelled { color: #dc3545; }
.order-items-detail { margin-top: 15px; padding-top: 10px; border-top: 1px dashed #ddd; }
.order-items-detail h4 { font-size: 1em; color: #666; margin-bottom: 8px; }
.order-items-detail ul { list-style: disc; padding-left: 20px; font-size: 0.9em; color: #777; }
.order-items-detail ul li { margin-bottom: 3px; }
.order-actions { margin-top: 20px; padding-top: 15px; border-top: 1px dashed #ddd; text-align: right; }
.mark-received-btn, .review-pending-items-btn { background-color: var(--success-color); color: white; padding: 8px 15px; border: none; border-radius: 5px; cursor: pointer; font-size: 0.9em; transition: background-color 0.2s ease; display: inline-block; }
.mark-received-btn:hover, .review-pending-items-btn:hover { background-color: #218838; }
.order-received-text { font-weight: bold; color: var(--success-color); font-size: 0.9em; margin-right: 10px; }

/* Saved Address/Payment Display Sections */
.saved-address-display {
    background-color: #e9f5ff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 1em;
    color: #333;
    line-height: 1.6;
    border: 1px solid #cce5ff;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}
.saved-address-display:hover {
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
    transform: translateY(-2px);
}
.saved-address-display .address-text-content {
    flex-grow: 1;
    margin-right: 10px;
}
.saved-address-display p { margin: 0 0 5px 0; }

/* Edit Button for Delivery Info & Payment Methods */
.saved-address-display .edit-button {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9em;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    z-index: 10;
    flex-shrink: 0;
    align-self: flex-start;
}
.saved-address-display .edit-button:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary-color-dark);
    transform: scale(1.05);
}
.saved-address-display .edit-button:active {
    transform: scale(0.95);
}

.premium-logout-btn {
    background-color: var(--danger-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
    margin-top: 30px;
    width: fit-content;
}
.premium-logout-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(220, 53, 69, 0.4);
}

/* Review Modal Item Styling (used within the modal) */
.review-modal-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    transition: all 0.3s ease-in-out;
}
.review-modal-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.review-modal-item:last-child { margin-bottom: 0; }
.review-modal-item-image { width: 80px; height: 80px; object-fit: cover; border-radius: 5px; margin-bottom: 10px; }
.review-modal-item h4 { font-size: 1.3em; color: #333; margin-bottom: 10px; }
.review-modal-item .form-group { width: 100%; margin-bottom: 15px; }
.review-modal-item label { font-weight: normal; font-size: 0.9em; color: #666; }
.review-modal-item .star-rating-input { font-size: 1.5em; margin-bottom: 10px; display: flex; gap: 5px; }
/* MODIFIED: Review Modal Stars to Gold */
.review-modal-item .star-rating-input i { color: #ccc; transition: color 0.2s ease; cursor: pointer; }
.review-modal-item .star-rating-input i.fas { color: #FFD700; }

/* Styling for image preview within forms */
.image-preview {
    width: 100px;
    height: 100px;
    border: 1px dashed #ccc;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em;
    color: #999;
    overflow: hidden;
    margin-top: 10px;
}
.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-modal-item textarea.review-modal-comment { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 0.95em; resize: vertical; min-height: 60px; box-sizing: border-box; }
.review-modal-item .submit-modal-review-btn { align-self: flex-end; padding: 8px 15px; font-size: 0.9em; }
.review-modal-item .review-modal-message { font-size: 0.85em; margin-top: 10px; width: 100%; text-align: center; color: var(--danger-color); }
.review-modal-item .review-modal-message.text-green-500 { color: var(--success-color); }


/* Account Tabs Styling */
.account-tabs-container {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 20px;
}
.account-tabs-nav {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.3s ease;
}
.tab-btn {
    padding: 15px 25px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.1em;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease-in-out;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    position: relative;
}
.tab-btn:hover {
    background-color: #e9ecef;
    color: #333;
}
.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: #eef2ff;
}
.account-tabs-content {
    padding: 25px;
    position: relative;
    overflow: hidden;
}
.tab-pane {
    display: none;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}
.tab-pane.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
    position: static;
}
.tab-pane { /* Override display:none with visibility to allow transition on initial load */
    visibility: hidden;
    height: 0;
}
.tab-pane.active {
    visibility: visible;
    height: auto;
}

.profile-delivery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.logout-area { text-align: center; }
.logout-area .premium-logout-btn { width: auto; }

.account-dashboard .my-messages {
    grid-column: 1 / -1;
}


/* --- MODAL CSS (General purpose: for window.showCustomMessageModal) --- */
.message-modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeInModalBg 0.3s ease-out forwards;
}

.message-modal-overlay.show {
    display: flex;
}

.message-modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 40px;
    border: none;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    animation: slideInModal 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    transform: translateY(-50px);
    opacity: 0;
}

/* Animations (for general message modal) */
@keyframes fadeInModalBg {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInModal {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal header/title (for general message modal) */
.message-modal-content h2 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
}

.message-modal-content h2 i {
    font-size: 1.2em;
}

/* Specific colors for modal titles based on type (added by JS) */
.message-modal-content h2.success {
    color: var(--success-color);
}
.message-modal-content h2.error {
    color: var(--danger-color);
}
.message-modal-content h2.info i {
    color: #17a2b8;
}

/* Modal message text (for general message modal) */
.message-modal-content p {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Modal button (for general message modal) */
.message-modal-content .btn-primary {
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.message-modal-content .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

/* --- MODAL CSS (specific to the Review Modal, using 'modal' classes) --- */
/* This is kept separate from the general message modal to maintain distinct styles if desired */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease-out;
}

/* Keyframe for review modal background fade-in */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Review modal slide-in animation */
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal .close-button {
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.modal .close-button:hover,
.modal .close-button:focus {
    color: #333;
    text-decoration: none;
    transform: scale(1.1);
}

/* Styles for the list of items within the modal to be reviewed */
#reviewItemsList {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Styles for individual review items within the modal */
.review-modal-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    transition: all 0.3s ease-in-out;
}

.review-modal-item:last-child {
    margin-bottom: 0;
}

.review-modal-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

.review-modal-item h4 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 10px;
}

.review-modal-item .form-group {
    width: 100%;
    margin-bottom: 15px;
}

.review-modal-item label {
    font-weight: normal;
    font-size: 0.9em;
    color: #666;
}

/* Specific styling for stars within the modal's review inputs */
.review-modal-item .star-rating-input {
    font-size: 1.5em;
    margin-bottom: 10px;
    display: flex;
    gap: 5px;
}

.review-modal-item .star-rating-input i {
    color: #ccc;
    transition: color 0.2s ease;
    cursor: pointer;
}

.review-modal-item .star-rating-input i.fas {
    color: #FFD700;
}


.review-modal-item textarea.review-modal-comment {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95em;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
}

.review-modal-item .submit-modal-review-btn {
    align-self: flex-end;
    padding: 8px 15px;
    font-size: 0.9em;
}

.review-modal-item .review-modal-message {
    font-size: 0.85em;
    margin-top: 10px;
    width: 100%;
    text-align: center;
}

/* Responsive adjustments for modal */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    .modal-content h2 {
        font-size: 1.5em;
    }
    .review-modal-item-image {
        width: 60px;
        height: 60px;
    }
}
/* Admin Panel Orders List Styles */

.admin-order-item {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}

.admin-order-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.admin-order-item p {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.admin-order-item ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.admin-order-item li {
    margin-bottom: 0.25rem;
}

/* Status Select and Save Button within Order Item */
.admin-order-item .status-select {
    border-color: #d1d5db;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    background-color: white;
}

.admin-order-item .save-btn {
    background-color: #3b82f6;
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.admin-order-item .save-btn:hover {
    background-color: #2563eb;
}

/* Status Text Colors */
.text-green-600 { color: #059669; }
.text-orange-600 { color: #ea580c; }
.text-blue-600 { color: #2563eb; }
.text-indigo-600 { color: #4f46e5; }

/* --- 7. Footer & Misc (Consolidated) --- */
footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    font-size: 0.95em;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

footer p {
    margin: 5px 0;
    transition: color 0.2s ease;
}
footer p:hover {
    color: rgba(255, 255, 255, 0.8);
}

#backToTopBtn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    transition: all 0.3s ease;
}

#backToTopBtn:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.6);
}
#backToTopBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}


/* --- 8. Responsive Adjustments (Consolidated & Refined) --- */
@media (max-width: 992px) {
    /* Checkout grid (single column on medium screens) */
    .checkout-grid {
        grid-template-columns: 1fr;
    }
    .order-summary-section {
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    /* Header/Navbar Adjustments */
    header .container {
        padding: 0 15px;
    }
    .navbar {
        flex-direction: column;
        align-items: center;
        padding: 10px 0;
        gap: 15px;
    }
    .logo {
        margin-bottom: 10px;
    }
    .search-container {
        order: 3;
        margin: 15px 0 0 0;
        width: 100%;
        max-width: none;
        padding: 0 15px;
        box-sizing: border-box;
    }
    .search-bar {
        width: 100%;
    }
    .nav-icons {
        margin-top: 10px;
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }
    .nav-icons a {
        padding: 8px 5px;
        flex-basis: 0;
        flex-grow: 1;
        min-width: 0;
        font-size: 0.85em;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }
    .cart-icon #cartCount {
        top: -5px;
        right: 0px;
        font-size: 0.6em;
        padding: 2px 5px;
        min-width: 15px;
    }

    /* Category Page Adjustments */
    .products h2#categoryTitle {
        font-size: 2em;
    }
    #filter-sort-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        align-items: end;
        margin-bottom: 24px;
        width: 100%;
        box-sizing: border-box;
        padding: 15px;
    }
    #filter-sort-container label {
        font-size: 0.7rem;
        font-weight: 500;
        margin-bottom: 3px;
    }
    #filter-sort-container .filter-group input,
    #filter-sort-container .sort-group select,
    #filter-sort-container button {
        padding: 5px 8px;
        font-size: 0.8rem;
        height: 34px;
    }
    #filter-sort-container button {
        grid-column: 1 / -1;
    }
    body #categoryProductGrid.product-list-view {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .product-card-info {
        display: flex;
        flex-direction: column;
        padding: 8px;
        flex-grow: 1;
    }
    /* MODIFIED: Product Name for single line on mobile */
    .product-card .product-name {
        font-size: 0.75rem; /* Further reduced for small screens */
        line-height: 1.3;
        height: 2.6em; /* Ensure enough height for possible two lines if text is very long */
        overflow: hidden;
        margin-bottom: 5px;
        white-space: normal; /* Allow wrapping on small screens if it helps readability or is unavoidable */
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Limit to 2 lines */
        -webkit-box-orient: vertical;
    }
    .product-card .product-rating {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 0.55rem;
    }
    .product-card .rating-text,
    .product-card .review-text {
        white-space: nowrap;
    }
    .product-card .product-rating .stars {
        font-size: 0.5rem;
        /* Re-added the rating stars CSS that was slightly malformed */
        color: #FFD700;
    }
    .product-rating {
        display: flex;
        align-items: center;
        font-size: 0.9em;
        color: #666;
        margin-bottom: 10px;
    }

    .product-rating .stars {
        color: #FFD700;
        margin-right: 5px;
    }
    .product-rating .rating-value {
        font-weight: bold;
    }
    .product-rating .review-count {
        margin-left: 5px;
    }

    .product-card .product-price {
        font-size: 0.95rem;
        font-weight: 700;
        margin-top: auto;
        padding-top: 8px;
    }
    .product-card .product-category {
        display: none;
    }
    .product-card-overlay {
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        padding: 4px;
    }
    .overlay-button {
        padding: 6px;
        font-size: 0.75rem;
        width: 90%;
        border-radius: 4px;
    }

    /* Product Details Page Adjustments */
    body#page-product-details .product-details-container {
        padding: 20px 15px;
        margin: 50px auto 30px auto;
    }
    body#page-product-details .product-details-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        width: 100%;
        box-sizing: border-box;
        gap: 20px;
    }
    body#page-product-details .product-image-section {
        width: 100%;
        text-align: center;
        overflow: hidden;
        box-sizing: border-box;
        padding: 0 10px;
    }
    body#page-product-details .product-image-section img {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 0 auto;
    }
    body#page-product-details .product-info-section {
        width: 100%;
        box-sizing: border-box;
        padding: 0 15px;
        overflow: hidden;
    }
    body#page-product-details .product-info-section h1 {
        font-size: 1.6rem;
        line-height: 2rem;
        margin-bottom: 10px;
        text-align: center;
    }
    body#page-product-details .product-info-section .description {
        font-size: 0.9rem;
        line-height: 1.5;
        overflow-wrap: break-word;
        word-break: break-word;
        white-space: normal;
        width: auto;
        max-width: 100%;
        box-sizing: border-box;
        padding-right: 0;
    }
    .price-section {
        text-align: center;
    }
    .price-section .current-price {
        font-size: 1.75rem;
        font-weight: 700;
    }
    .variants-section h3, .color-options-section h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    .product-info-section div[style*="grid-template-columns"] {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: flex-end;
        justify-content: center;
    }
    .quantity-add-section {
        flex-grow: 1;
        min-width: 80px;
    }
    .add-to-cart-button {
        flex-grow: 2;
        padding: 12px;
        font-size: 1rem;
    }
    .reviews-section h2, #writeReviewHeading {
        font-size: 1.5em;
    }
    #reviewFormContainer {
        padding: 20px;
    }

    /* Cart Page Adjustments */
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .cart-item-quantity {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
        margin-top: 10px;
    }
    .cart-item-price {
        width: 100%;
        text-align: left;
        margin-left: 0;
        margin-top: 10px;
    }
    .cart-item .remove-item-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        margin-left: 0;
    }

    /* Account Page Adjustments */
    .account-page-container {
        padding: 20px;
        margin: 50px auto 30px auto;
    }
    .auth-form-container {
        padding: 20px;
    }
    .account-tabs-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        padding: 10px;
    }
    .tab-btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    .account-tabs-content {
        padding: 15px;
    }
    .profile-delivery-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .product-list-view {
        grid-template-columns: 1fr;
    }
}

/* Keyframes for global use (ensure no duplicates) */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@-webkit-keyframes fadeIn { /* Webkit prefix for older browsers */
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeInSlideUp { /* From product details */
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@-webkit-keyframes fadeInSlideUp { /* Webkit prefix */
    from { opacity: 0; -webkit-transform: translateY(20px); transform: translateY(20px); }
    to { opacity: 1; -webkit-transform: translateY(0);  transform: translateY(0); }
}
/* Spinner keyframe already defined above and refined */
/* --- Responsive Adjustments for Hero Section Text (New) --- */
@media (max-width: 768px) {
    /* Adjustments for tablets and smaller devices */
    .hero-content h1 {
        font-size: 3em; /* Reduced from 4.5em for better fit */
        margin-bottom: 10px;
    }

    .hero-content p {
        font-size: 1.2em; /* Reduced from 1.8em */
        padding: 0 10px; /* Add some horizontal padding to prevent text from touching edges */
    }
}

@media (max-width: 576px) {
    /* Further adjustments for smaller mobile phones */
    .hero-content h1 {
        font-size: 2.2em; /* Further reduction for very small screens */
        line-height: 1.1;
    }

    .hero-content p {
        font-size: 0.9em; /* Further reduction */
        line-height: 1.4;
    }

    /* Optionally, if the hero section height itself is too much on small phones */
    .hero-section {
        height: 350px; /* Adjust hero section height for mobile */
    }
}
/* --- Account Page Tabs: PC View Adjustments (Refined for all tabs, especially longer text) --- */

@media (min-width: 992px) { /* Applies to screens 992px wide and larger (typical PC view) */
    .account-tabs-nav {
        display: flex; /* Ensure flex is maintained */
        flex-wrap: wrap; /* Allow tabs to wrap to the next line if space is limited */
        justify-content: center; /* Center the tabs if they wrap, or distribute evenly */
        gap: 10px; /* Add a consistent gap between tabs */
        max-width: 100%; /* Allow the tab container to use full available width */
        padding: 0; /* Remove any padding that might make the overall nav too wide */
        margin: 0 auto; /* Center the tab navigation bar */
    }

    .tab-btn {
        font-size: 0.95em; /* Slightly smaller font size for desktop tabs */
        padding: 10px 18px; /* Reduced padding for desktop tabs */
        white-space: nowrap; /* Prevent text from wrapping inside the button */
        flex-shrink: 0; /* Prevent tabs from shrinking too much */
        flex-grow: 0; /* Prevent tabs from growing too much */
        min-width: fit-content; /* Ensure the button takes only as much width as its content needs */
        box-sizing: border-box; /* Include padding/border in the element's total width/height */
    }

    /* Specific adjustment for the "Become a Seller" tab due to its length */
    #sellerApplicationTabBtn {
        font-size: 0.85em; /* Make this specific tab's font a bit smaller */
        padding: 8px 15px; /* Adjust padding to match smaller font */
    }
}
/* Basic Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top */
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none; /* Allows clicks to pass through when hidden */
}

/* Basic Spinner Styles */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #333; /* Darker color for the spinning part */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
/* --- Loading Overlay Styles (for Cart, Checkout, Account pages) --- */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white background */
    display: flex;
    flex-direction: column; /* Stack spinner and text vertically */
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Ensure it's on top of other content */
    opacity: 1; /* Start visible, will be hidden by JS */
    transition: opacity 0.3s ease-out; /* Smooth fade out */
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none; /* Allows clicks to pass through when hidden */
    visibility: hidden; /* Ensures it doesn't take up space when hidden */
}

.spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #4CAF50; /* Green */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite; /* Spin animation */
    margin-bottom: 20px; /* Space between spinner and text */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    font-size: 1.2em;
    color: #555;
    font-weight: bold;
}

/* Optional: Adjust for specific areas if you have local loading spinners */
/* For example, if you have a local spinner in cartItemsListEl, you might want to style it differently */
/* Or simply remove the old "Loading your cart..." text when you apply the overlay */
.cart-page-container p.loading-text { /* If you have a specific class for the "Loading your cart..." text */
    display: none;
}
/* --- Seller Application Modal Base Styles --- */
#sellerApplicationModal {
    /* Overlay that covers the entire screen */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Darker, slightly transparent background */
    display: flex; /* Use flexbox to center content */
    justify-content: center; /* Center horizontally */
    align-items: center;   /* Center vertically */
    z-index: 10000;        /* Ensure it's on top of everything */
    opacity: 0;            /* Start invisible */
    visibility: hidden;    /* Hidden from screen readers and interaction */
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out; /* Smooth fade effect */
}

#sellerApplicationModal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Allows clicks to pass through when hidden */
}

/* Show modal */
#sellerApplicationModal:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Allows interaction when visible */
}

/* --- Modal Content Styles (The actual dialog box) --- */
#sellerApplicationModal .modal-content {
    background-color: #ffffff; /* White background for the dialog */
    padding: 30px; /* More padding for premium feel */
    border-radius: 12px; /* Slightly more rounded corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); /* Stronger, softer shadow */
    max-width: 550px; /* A bit wider for form content */
    width: 90%; /* Responsive width */
    max-height: 90vh; /* Max height to prevent overflow on small screens */
    overflow-y: auto; /* Enable scrolling for long forms */
    transform: scale(0.95); /* Slightly scale down when hidden */
    transition: transform 0.3s ease-out, opacity 0.3s ease-out; /* Smooth transition for appearance */
    position: relative; /* For positioning close button */
}

#sellerApplicationModal:not(.hidden) .modal-content {
    transform: scale(1); /* Scale to normal size when visible */
    opacity: 1;
}

/* --- Modal Header and Close Button --- */
#sellerApplicationModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px; /* Add padding below header */
    border-bottom: 1px solid #eee; /* Subtle separator */
}

#sellerApplicationModal .modal-header h2 {
    font-size: 1.8em; /* Slightly larger title */
    color: #333;
    margin: 0;
}

#sellerApplicationModal .close-button {
    background: none;
    border: none;
    font-size: 1.8em; /* Larger 'x' */
    color: #888;
    cursor: pointer;
    padding: 5px;
    line-height: 1; /* Better alignment */
    transition: color 0.2s ease-in-out;
}

#sellerApplicationModal .close-button:hover {
    color: #333;
}

/* --- Form Specific Styles (within modal) --- */
#sellerApplicationModal .form-group {
    margin-bottom: 15px; /* Consistent spacing */
}

#sellerApplicationModal label {
    font-weight: 600; /* Slightly bolder labels */
    color: #555;
    margin-bottom: 5px;
    display: block;
}

#sellerApplicationModal input[type="text"],
#sellerApplicationModal input[type="email"],
#sellerApplicationModal input[type="tel"],
#sellerApplicationModal input[type="file"],
#sellerApplicationModal select {
    width: 100%;
    padding: 12px; /* More padding for inputs */
    border: 1px solid #ddd; /* Subtle border */
    border-radius: 8px; /* Rounded input fields */
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
    margin-top: 5px;
}

#sellerApplicationModal input[type="file"] {
    padding: 8px; /* Adjust padding for file input */
}

#sellerApplicationModal .form-hint {
    font-size: 0.85em;
    color: #777;
    margin-top: 5px;
}

#sellerApplicationModal .form-section-title {
    font-size: 1.4em;
    color: #444;
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px dashed #eee; /* Dashed separator for sections */
    padding-bottom: 10px;
}

#sellerApplicationModal .image-preview {
    margin-top: 10px;
    border: 1px dashed #ccc;
    padding: 10px;
    min-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    font-size: 0.9em;
    border-radius: 8px;
}

#sellerApplicationModal .image-preview img {
    max-width: 100%;
    max-height: 150px; /* Limit preview image height */
    border-radius: 5px;
    object-fit: contain;
}

#sellerApplicationModal .btn-primary {
    padding: 12px 25px; /* Larger buttons */
    font-size: 1.1em;
    border-radius: 8px; /* Rounded buttons */
    /* Assuming your .btn-primary has background-color and color */
}

#sellerApplicationModal .btn-loader {
    margin-left: 10px;
    /* Styles for spinner within button */
}

/* Optional: Improve grid layout for form groups if needed */
#sellerApplicationModal .grid.grid-cols-1.md\:grid-cols-2.gap-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}
@media (min-width: 768px) {
    #sellerApplicationModal .grid.grid-cols-1.md\:grid-cols-2.gap-4 {
        grid-template-columns: 1fr 1fr;
    }
}
/* =================================== */
/* == Premium Account Page Styles == */
/* =================================== */

/* Main wrapper for the two-column layout */
.premium-auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    width: 100%;
    min-height: calc(100vh - 80px); /* Full height minus header */
}

/* 1. The Visual/Branding Side (Left) */
.auth-visual {
    background-image: linear-gradient(rgba(18, 26, 49, 0.7), rgba(18, 26, 49, 0.9)), url('https://images.unsplash.com/photo-1526178613552-2b45c6c302f0?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1770&q=80');
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
}

.auth-visual-content .logo {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    display: block;
    text-shadow: 0 2px 15px rgba(0,0,0,0.2);
}

.auth-visual-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.auth-visual-content p {
    font-size: 1.1rem;
    max-width: 400px;
    color: rgba(255, 255, 255, 0.8);
}


/* 2. The Form Panel Side (Right) */
.auth-form-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f7f7f7; /* A very light grey background */
}

/* We override the margin for the form container to center it properly */
.auth-form-panel .account-page-container {
    margin: 0;
    padding: 20px;
    width: 100%;
    max-width: 450px;
}

.auth-form-panel h1 {
    display: none; /* Hide the "My Account" title on this view */
}

/* Form container enhancements */
.auth-form-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
}

.auth-form-container h2 {
    margin-bottom: 25px;
    font-size: 2rem;
    text-align: center;
}

/* Input field enhancements */
.auth-form-container .form-group input {
    background-color: #f7f9fc;
    border: 1px solid #e0e6f1;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.auth-form-container .form-group input:focus {
    border-color: #007bff;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* Button enhancements */
.auth-form-container .btn-primary {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
    transition: all 0.3s ease;
}

.auth-form-container .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

/* Links below form */
.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .premium-auth-wrapper {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }
    .auth-visual {
        display: none; /* Hide the visual side on mobile to save space */
    }
    .auth-form-panel {
        padding: 20px;
    }
}
/* ===================================== */
/* == Premium Customer Support Chat == */
/* ===================================== */

/* The notification dot on the tab button */
.tab-btn {
    position: relative;
}

#supportNotificationIcon {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 9px;
    height: 9px;
    background-color: #ff3d71;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 5px rgba(255, 61, 113, 0.7);
}

/* Container for the redesigned message input area */
.message-input-container {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f0f2f5;
    border-top: 1px solid #ddd;
}

.message-input-container label.attach-file-btn {
    font-size: 1.5rem;
    color: #555;
    padding: 10px;
    cursor: pointer;
    transition: color 0.2s;
}

.message-input-container label.attach-file-btn:hover {
    color: #007bff;
}

/* Hide the default file input */
.message-input-container input[type="file"] {
    display: none;
}

.message-input-container textarea {
    flex-grow: 1;
    border: none;
    border-radius: 20px;
    padding: 12px 18px;
    resize: none;
    background-color: #fff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    height: 48px; /* Set a fixed initial height */
    line-height: 1.4;
}

.message-input-container textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.4);
}

.message-input-container button[type="submit"] {
    margin-left: 10px;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#filePreviewContainer {
    font-size: 0.85em;
    color: #555;
    margin-top: -5px;
    padding: 0 15px 10px 15px;
    background-color: #f0f2f5;
}

/* New chat bubble styles */
.message-history {
    padding: 15px;
    background-color: #e5ddd5; /* WhatsApp-like background */
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-item {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.message-bubble {
    padding: 10px 15px;
    border-radius: 18px;
    color: #333;
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* User's messages align to the right */
.message-item.sender-user {
    align-self: flex-end;
}
.message-item.sender-user .message-bubble {
    background-color: #dcf8c6;
    border-bottom-right-radius: 4px;
}
.message-item.sender-user .message-meta {
    text-align: right;
    margin-right: 5px;
}

/* Admin's messages align to the left */
.message-item.sender-admin {
    align-self: flex-start;
}
.message-item.sender-admin .message-bubble {
    background-color: #ffffff;
    border-bottom-left-radius: 4px;
}
.message-item.sender-admin .message-meta {
    margin-left: 5px;
}


.message-meta {
    font-size: 0.75rem;
    color: rgba(0,0,0,0.5);
    margin-top: 4px;
}

/* Attachment styles */
.message-attachment img, .message-attachment video {
    width: 100%; /* Make attachments fill the bubble width */
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin-top: 5px;
    cursor: pointer;
}

.message-attachment a {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0,0,0,0.05);
    padding: 10px;
    border-radius: 8px;
    margin-top: 5px;
    text-decoration: none;
    color: #007bff;
}

.message-attachment a:hover {
    background-color: rgba(0,0,0,0.1);
}
/* Custom CSS for Seller Panel Mobile View */

/* Important: This media query targets screens up to 767px (typical 'md' breakpoint minus 1px) */
@media (max-width: 767px) {
    /* Overrides the 'hidden' class on #sellerPanelContent for mobile screens */
    #sellerPanelContent {
        display: flex !important; /* Ensure the panel is visible on mobile */
        flex-direction: column;   /* Stack elements vertically on mobile */
        min-height: 100vh;        /* Ensure it takes full viewport height */
        width: 100%;              /* Take full width */
    }

    /* Mobile-specific header adjustments */
    #sellerPanelContent header {
        padding: 1rem; /* Adjust padding */
        display: flex; /* Ensure it's a flex container */
        align-items: center; /* Vertically center items */
        justify-content: space-between; /* Space out elements, useful for menu button + title */
        position: sticky; /* Make header sticky */
        top: 0;
        z-index: 30; /* Ensure header is above content but below sidebar */
    }

    /* Welcome message in mobile header */
    #welcomeMessage {
        font-size: 1.1rem; /* Slightly smaller font for mobile */
        margin-top: 0;     /* Remove any unwanted top margin */
        flex-grow: 1;      /* Allow it to take available space */
        text-align: center; /* Center the welcome message by default */
    }

    /* Mobile menu button (you will need to add this button to your HTML) */
    .mobile-menu-button {
        display: block; /* Show the hamburger menu button on mobile */
        background: none;
        border: none;
        font-size: 1.8rem; /* Larger icon for tap target */
        color: #4f46e5; /* Indigo color */
        cursor: pointer;
        padding: 0.25rem; /* Add some padding for easier tapping */
        order: -1; /* Place it at the beginning of flex items in the header */
    }

    /* Sidebar behavior for mobile */
    #sellerPanelContent aside {
        position: fixed; /* Make sidebar fixed relative to viewport */
        top: 0;
        left: -250px; /* Initially hidden off-screen (adjust width if your sidebar is wider) */
        width: 250px; /* Fixed width for the mobile sidebar */
        height: 100vh; /* Full viewport height */
        z-index: 100; /* High z-index to overlay content */
        transition: left 0.3s ease-in-out; /* Smooth slide transition */
        box-shadow: 2px 0 5px rgba(0,0,0,0.2); /* Add shadow for depth */
        display: flex !important; /* Ensure it's flex when visible (overrides any desktop display) */
        flex-direction: column; /* Keep sidebar content stacked */
    }

    /* Class added by JavaScript to show the sidebar */
    #sellerPanelContent.sidebar-open aside {
        left: 0; /* Slide sidebar into view */
    }

    /* Backdrop/Overlay when sidebar is open */
    .sidebar-backdrop {
        position: fixed;
        inset: 0; /* Cover the whole viewport */
        background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black overlay */
        z-index: 90; /* Below sidebar, above main content */
        display: none; /* Hidden by default */
        cursor: pointer; /* Indicate it's clickable to close sidebar */
    }

    /* Show backdrop when sidebar is open */
    #sellerPanelContent.sidebar-open + .sidebar-backdrop {
        display: block; /* Show backdrop when sidebar is open */
    }

    /* Main content area padding adjustment for mobile */
    #sellerPanelContent main {
        padding: 1rem; /* Smaller padding on mobile */
    }

    /* Dashboard stat cards layout for mobile */
    #dashboard-tab .grid {
        grid-template-columns: 1fr; /* Stack stat cards vertically on mobile */
        gap: 1rem; /* Smaller gap */
    }

    /* Product list table responsiveness */
    /* The `overflow-x-auto` class on the table wrapper already handles horizontal scrolling. */
    #products-tab table th,
    #products-tab table td {
        padding: 0.75rem; /* Slightly reduced padding for table cells */
        font-size: 0.875rem; /* Smaller font size for table text */
    }

    /* Hide the Image column on very small screens to save space */
    #sellerProductList th:first-child,
    #sellerProductList td:first-child {
        display: none;
    }

    /* Product form layout for mobile */
    #addProductFormContainer .grid {
        grid-template-columns: 1fr; /* Stack form fields vertically */
    }

    /* Adjust button group spacing in forms */
    #sellerProductForm .flex.justify-end.space-x-4 {
        flex-direction: column; /* Stack buttons vertically */
        gap: 0.75rem; /* Add some space between stacked buttons */
        margin-top: 1rem; /* Add margin above buttons */
    }
    #sellerProductForm .flex.justify-end.space-x-4 button {
        width: 100%; /* Make buttons full width */
    }
}

/* Desktop styles (md and up) - ensure mobile-specific elements are hidden */
@media (min-width: 768px) {
    /* Hide the mobile menu button on desktop */
    .mobile-menu-button {
        display: none;
    }

    /* Ensure the sidebar is visible and in its normal flow on desktop */
    #sellerPanelContent aside {
        position: relative; /* Reset to normal flow */
        left: 0;
        display: flex !important; /* Ensure it's flex for desktop */
        width: 64; /* Re-apply desktop width from Tailwind if needed, or let Tailwind handle */
    }
    
    /* Hide backdrop on desktop */
    .sidebar-backdrop {
        display: none;
    }
}
.price-section {
    text-align: left;
}
.loading-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
    width: 100%;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #09f; /* You can change this color */
    animation: spin 1s ease infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
.product-list-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.product-list-item.visible {
    opacity: 1;
    transform: translateY(0);
}
/* --- NEW: Specific Loading Overlay and Spinner for Cart Page --- */

#cartPageLoadingOverlay {
    /* Base overlay styles */
    position: fixed; /* Covers the whole viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Darker, slightly transparent background for a premium feel */
    display: flex; /* Flexbox for centering content */
    flex-direction: column; /* Stack spinner and text vertically */
    justify-content: center; /* Center vertically */
    align-items: center; /* Center horizontally */
    z-index: 10000; /* Extremely high z-index to ensure it's always on top */
    transition: opacity 0.4s ease, visibility 0.4s ease; /* Smooth fade in/out */
    backdrop-filter: blur(5px); /* Add a subtle blur effect for modern look */
    -webkit-backdrop-filter: blur(5px); /* Webkit prefix for compatibility */
}

#cartPageLoadingOverlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Allows clicks to pass through when hidden */
}

/* Spinner for Cart Page (Distinct Look) */
#cartPageLoadingOverlay .spinner {
    border: 8px solid rgba(255, 255, 255, 0.2); /* Lighter border for contrast on dark background */
    border-top: 8px solid var(--primary-color); /* Your primary blue for the spinning part */
    border-radius: 50%;
    width: 70px; /* Slightly larger spinner */
    height: 70px;
    animation: cartSpin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite; /* More dynamic, slightly bouncy spin */
    margin-bottom: 25px; /* More space between spinner and text */
}

/* Keyframes for the new cart spinner animation */
@keyframes cartSpin {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg) scale(1.1); } /* Slight bounce/enlarge mid-spin */
    100% { transform: rotate(360deg) scale(1); }
}

#cartPageLoadingOverlay p {
    font-size: 1.4em; /* Larger, more prominent text */
    color: var(--light-color); /* White text for contrast on dark background */
    font-weight: 600; /* Bolder text */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); /* Subtle text shadow for readability */
}
.nav-icons .admin-icon {
    display: none;
}
/* --- END: Specific Loading Overlay and Spinner for Cart Page --- */
/* ============================================= */
/* === Fix for Live Search Image Size Bug === */
/* ============================================= */

.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px; /* Adds a nice space between the image and text */
}

.search-result-item img {
    width: 50px;       /* Set a fixed width for the thumbnail */
    height: 50px;      /* Set a fixed height for the thumbnail */
    object-fit: cover; /* This makes the image cover the 50x50 area without stretching */
    flex-shrink: 0;    /* Prevents the image from shrinking if the text is long */
    border-radius: 4px; /* Optional: adds slightly rounded corners */
}
/* ============================================= */
/* === Local Shop Feature Section Styling === */
/* ============================================= */

.local-shop-feature {
    padding-top: 2rem;
    padding-bottom: 2rem;
}
/* ========================================================= */
/* --- FINAL CARD, IMAGE, & SKELETON FIX (JULY 25) --- *
/* ========================================================= */

/*
  FIX 1: Prevents images from being cropped and stretched on ALL cards.
  This targets both the local marketplace and individual shop pages.
*/
#page-local-shop .product-card .product-card-image-wrapper,
#page-shop .product-card .product-card-image-wrapper {
    
    display: block;
    aspect-ratio: 4 / 3;
    background-color: #f8f8f8;
    overflow: hidden !important;
}

#page-local-shop .product-card img,
#page-shop .product-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; /* Shows the full image */
    padding: 0.5rem !important; /* Adds a small margin around the image */
}

/*
  FIX 2: Creates a responsive grid for ALL card sections.
*/
#localShopProductGrid,
.shop-page .category-grid,
.shop-page .product-grid {
    display: grid !important;
    /* This creates a multi-column layout on desktop */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 1.5rem !important;
}

/* On mobile, this makes the cards smaller for a 2-column layout */
@media (max-width: 640px) {
  #localShopProductGrid,
  .shop-page .category-grid,
  .shop-page .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 0.75rem !important;
  }
}
/* ========================================================= */
/* --- FINAL PAGE TRANSITION & CARD FIXES --- */
/* ========================================================= */

/*
  FIX 1: This is the full-page loader styled to look like YOUR blue loader.
*/
.page-transition-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.page-transition-loader.visible {
    opacity: 1;
    visibility: visible;
}
.page-transition-loader .loading-message {
    padding: 2rem 3rem;
    background-color: #f0f8ff; /* Light blue background */
    border: 1px solid #cce4ff; /* Blue border */
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    color: #004085; /* Dark blue text */
    text-align: center;
}

/*
  FIX 2: This creates the smooth fade-in/fade-out animation for page transitions.
*/
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
body.body-fade-in {
    animation: fadeIn 0.4s ease-in-out;
}
body.body-fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/*
  FIX 3: This permanently fixes the image movement/layout shift on ALL cards.
*/
#page-local-shop .product-card-image-wrapper,
#page-shop .product-card-image-wrapper {
    display: block;
    aspect-ratio: 4 / 3;
    background-color: #f8f8f8;
}
.local-shop-card {
    display: block;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1524178232363-1fb2b075b655?q=80&w=2070');
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.local-shop-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.local-shop-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.local-shop-card p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.local-shop-card .btn.btn-primary {
    background-color: white;
    color: #4f46e5;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.2s, color 0.2s;
}

.local-shop-card:hover .btn.btn-primary {
    background-color: #4f46e5;
    color: white;
}
/* A more specific selector that only targets the shop page */
#page-shop .category-group-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}
/* Fix for hero section layout shift */
.hero-section#localShopHero {
    min-height: 300px; /* Gives the section a height before the image loads */
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Final version for Desktop Product Card Layout */
@media (min-width: 768px) {
    /* This sets up the text container */
    .product-card-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* Aligns name/stars to the left */
        flex-grow: 1; /* Allows the container to fill space */
        padding: 15px;
    }

    /* This adds space between the name and the stars */
    .product-card-info .product-name {
        margin-bottom: 8px; /* Adjust space as you like */
    }

    /* This hides the category text ("Phones") */
    .product-card-info p:first-of-type {
        display: none;
    }

    /* This styles and positions the price */
    .product-price { /* You may need to change this class name */
        /* --- CHANGED LINES --- */
        font-size: 1.1em;    /* Shrunk the font a little more */
        margin-top: 16px;    /* Created a fixed space below the stars */
        /* ------------------- */
        font-weight: bold;
        align-self: flex-end; /* Moves the price to the right */
    }
}

/* This ensures the parent card is also a flex container */
.product-card {
    display: flex;
    flex-direction: column;
}
/* =================================== */
/* ===== Mobile Navigation Fix ====== */
/* =================================== */

/* This rule applies to screens smaller than 768px */
@media (max-width: 768px) {
  .nav-icons {
    width: 100%; /* Make the container take the full width */
    justify-content: space-around; /* Distribute items evenly with space around them */
  }
  .nav-icons a {
    /* Reduce the font size of the text */
    font-size: 0.75rem; 
    /* Add a little more space between icons */
    padding: 0 4px;
  }

  /* This hides the text part of the link */
  .nav-icons a .fa-home + span,
  .nav-icons a .fa-store + span,
  .nav-icons a .fa-heart + span,
  .nav-icons a .fa-shopping-cart + span,
  .nav-icons a .fa-user + span,
  .nav-icons a .fa-user-shield + span {
    display: none;
  }
}
/* =================================== */
/* ===== Footer Link Styles ======== */
/* =================================== */

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem; /* Adds space between the links */
    margin: 1rem 0;
}

.footer-links a {
    color: #d1d5db; /* A nice, light gray color */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.footer-links a:hover {
    color: #ffffff; /* Make the link white on hover */
    text-decoration: underline;
}
/* =================================== */
/* ===== Mobile Navigation Fix ====== */
/* =================================== */

@media (max-width: 768px) {
  /* Make the navbar a column layout on mobile */
  .navbar {
    flex-direction: column;
    gap: 1rem;
  }

  /* This is the main fix for spacing */
  .nav-icons {
    width: 100%; /* Make the container take the full width */
    display: flex;
    justify-content: space-between; /* This pushes the first and last items to the edges */
    align-items: center;
  }

  /* This styles each individual link */
  .nav-icons a {
    display: flex;
    flex-direction: column; /* Stack icon on top of text */
    align-items: center;
    font-size: 0.8rem; /* Slightly larger font size */
    padding: 0 2px; /* Minimal horizontal padding */
    gap: 4px; /* Space between icon and text */
  }

  /* This ensures the text labels are visible */
  .nav-icons a > span {
    display: block !important;
  }
  .cart-icon {
    position: relative; /* This is essential for positioning the dot */
  }

  .cart-icon #cartCount {
    position: absolute;
    top: -8px; /* Position it above the icon */
    right: -8px; /* Position it to the right of the icon */
    background-color: #ef4444; /* Red color */
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    line-height: 18px; /* Center the number vertically */
    text-align: center;
    font-weight: bold;
    display: block; /* Make it visible */
  }

  /* This rule hides the red dot when the cart is empty */
  .cart-icon #cartCount:empty,
  .cart-icon #cartCount:contains('0') {
      display: none;
  }
  .footer-links {
    gap: 0.75rem; /* Reduce space between links */
    flex-wrap: wrap; /* Allow links to wrap to the next line if needed */
    justify-content: center;
  }

  .footer-links a {
    font-size: 0.8rem; /* Make the font smaller */
  }
}
/* =================================== */
/* ===== Hero Section Text Color ===== */
/* =================================== */

.hero-content h1{
    color: #f1860c !important;
}
.hero-content p {
    color: #5d00ff !important;
}
/* =================================== */
/* == Local Shop Feature Text Color == */
/* =================================== */

.local-shop-card h2 {
    color: #ffffff !important;
}
/* =================================== */
/* ===== Page Load Fade-In Effect ==== */
/* =================================== */

/* Initially hide the main content */
main {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* This class will be added by a tiny script to trigger the fade-in */
body.loaded main {
    opacity: 1;
}
/* --- Skeleton Loading Styles --- */
.skeleton-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
}

.skeleton-image {
    width: 100%;
    height: 150px;
    background-color: #e5e7eb; /* Light gray */
    border-radius: 8px;
    margin-bottom: 15px;
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-text {
    height: 20px;
    background-color: #e5e7eb; /* Light gray */
    border-radius: 4px;
    width: 80%;
    margin: 0 auto;
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}
.category-card.category-loading {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.4s ease-out;
}
/* --- Account Page Skeleton Styles --- */
.account-skeleton {
    max-width: 500px;
    margin: 40px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.skeleton-title {
    height: 38px;
    width: 60%;
    margin: 0 auto 25px auto;
    background-color: #e5e7eb;
    border-radius: 8px;
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-label {
    height: 16px;
    width: 40%;
    margin-bottom: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-input {
    height: 50px;
    width: 100%;
    margin-bottom: 15px;
    background-color: #e5e7eb;
    border-radius: 8px;
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-button {
    height: 50px;
    width: 100%;
    margin-top: 10px;
    background-color: #e5e7eb;
    border-radius: 8px;
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
/* --- Admin Panel "View More" Buttons (Conflict-Free) --- */

/* This targets any element with the class 'view-more-btn' ONLY if it's inside the admin panel */
#mainAdminContent .view-more-btn {
    display: none; /* Hidden by default until the JavaScript shows it */
    width: fit-content;
    margin: 2rem auto;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    background-color: #0d6efd; /* Premium blue */
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
}

#mainAdminContent .view-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.5);
}

#mainAdminContent .view-more-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Optional but recommended for a cleaner look */
.cart-item-image {
    background-color: #f8fafc !important; /* A very light grey for the background */
}
/* --- Fix for Page FOUC (Flash of Unconverted Currency) --- */
.cart-page-container, .checkout-page-container {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out;
}
/* --- Checkout Summary Item Price Color Fix --- */
.order-summary-section .cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
}
/* --- NEW: Notification Dot Style with !important --- */
/* This version uses !important to override any conflicting styles */

#sellerPanelContent .sidebar-link {
    position: relative !important;
}

#sellerPanelContent .notification-dot {
    display: none !important;
    position: absolute !important;
    top: 10px !important;
    right: 15px !important;
    width: 9px !important;
    height: 9px !important;
    background-color: #ef4444 !important; /* Red color */
    border-radius: 50% !important;
    border: 1.5px solid #1f2937 !important; /* Matches sidebar background */
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.7) !important;
}

#sellerPanelContent .notification-dot.active {
    display: inline-block !important; /* Show the dot */
    animation: pulse-dot 1.5s infinite !important;
}

@keyframes pulse-dot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}
/* Added to style.css for sign in with google and facebook */
/* In style.css, replace the old social button styles with this */

.social-auth-container {
    max-width: 450px; /* Widen the container to fit buttons side-by-side */
    margin: 0 auto 1.5rem auto;
    display: flex;
    flex-direction: row; /* This is the key change: from column to row */
    justify-content: center; /* Center the buttons within the container */
    gap: 1rem; /* Add a gap between the buttons */
}
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    /* width: 100%; <-- We removed this to stop the stretching */
    padding: 0.6rem 1rem; /* Adjust padding for a sleeker look */
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-weight: 500; /* Slightly lighter font weight */
    font-size: 0.9rem; /* Slightly smaller font size */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.social-btn:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.social-btn i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
}
.social-btn.google { background-color: #fff; color: #4b5563; }
.social-btn.google:hover { background-color: #f9fafb; border-color: #cacdd2; }
.social-btn.facebook { background-color: #1877f2; color: #fff; border-color: #1877f2;}
.social-btn.facebook:hover { background-color: #166fe5; }

/* The divider style (unchanged but included for completeness) */
.auth-divider { 
    display: flex; align-items: center; text-align: center; 
    color: #9ca3af; margin-bottom: 1.5rem;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; border-bottom: 1px solid #e5e7eb;
}
.auth-divider:not(:empty)::before { margin-right: .5em; }
.auth-divider:not(:empty)::after { margin-left: .5em; }

/* ======================================================= */
/* == PREMIUM Mobile Two-Column Category Layout (NEW) == */
/* ======================================================= */

/* This applies only to screens 768px wide or smaller */
@media (max-width: 768px) {
    
    /* This creates the two-column grid */
    #mainCategoryGrid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Two equal-width columns */
        gap: 1rem;
    }

    /* This styles the card itself for a cleaner look */
    .category-card {
        background-color: #ffffff;
        border-radius: 0.75rem; /* Softer corners */
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
        overflow: hidden; /* Important for the image's rounded corners */
        transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
        border: 1px solid #f3f4f6; /* A subtle border */
    }

    /* Add a nice "lift" effect on hover */
    .category-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    }

    /* This is the key fix for the image shape */
    .category-card img {
        width: 100%;
        display: block;
        aspect-ratio: 1 / 1; /* Makes the image area a perfect square */
        object-fit: cover;   /* Ensures the image fills the square without distortion */
    }

    /* This styles the text area below the image */
    .category-card .category-card-info {
        padding: 0.75rem;
        text-align: center; /* Center the category name */
    }

    /* This styles the category name text */
    .category-card h3 {
        font-size: 0.875rem; /* 14px, a good size for mobile */
        font-weight: 600;
        color: #1f2937;
    }
}
.country-select-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.country-select-button:hover {
    border-color: #4f46e5;
}

#countrySelectText {
    color: #495057;
}

#countrySelectText.placeholder {
    color: #6c757d;
}

/* Styles for the Country Modal */
.country-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.country-modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.country-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.country-modal-overlay:not(.hidden) .country-modal-content {
    transform: scale(1);
}

.country-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.country-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.country-modal-body {
    padding: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.country-search-container {
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 5px;
    padding: 0 10px;
    margin-bottom: 1rem;
}

.country-search-container i {
    color: #6c757d;
}

#countrySearchInput {
    width: 100%;
    border: none;
    outline: none;
    padding: 10px;
    font-size: 1rem;
}

.country-list {
    overflow-y: auto;
    flex-grow: 1;
}

.country-item {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.country-item:hover {
    background-color: #f1f3f5;
}

.country-flag {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.country-name {
    font-size: 1rem;
}