/* ============================================
   Kaspa Store - Main Stylesheet
   Optimized and Organized Version
============================================ */

/* ============================================
   1. CSS VARIABLES & RESET
============================================ */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --dark-color: #2d3748;
    --light-color: #f7fafc;
    --border-color: #e2e8f0;
    --text-color: #4a5568;
    --gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 108px;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background: var(--light-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 0;
    margin: 0;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* ============================================
   2. LAYOUT CONTAINERS
============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.header .container {
    max-width: 100%;
    width: 100%;
    padding: 0 2rem;
}


.main-content {
    padding: 2rem 0;
    padding-top: 140px;
    min-height: calc(100vh - 120px);
    padding-bottom: 2rem;
}

.main-content .container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* ============================================
   3. HEADER STYLES
============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* Main Header Bar */
.header-main,
.header-top {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
    height: 60px;
    display: flex;
    align-items: center;
}

.header-content,
.header-top-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 60px;
}

/* Logo Section */
.logo-section,
.logo-link {
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.logo-link:hover,
.logo:hover {
    transform: translateY(-2px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.logo-icon {
    font-size: 2.5rem;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.2;
}

.tagline {
    font-size: 0.75rem;
    color: #718096;
    font-weight: 500;
}

/* Search Section */
.search-section {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 2rem;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 900px;
}

.search-box {
    display: flex;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    position: relative;
    width: 100%;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    background: transparent;
    outline: none;
    font-size: 0.9375rem;
    min-width: 0;
}

.search-box:focus-within {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.search-btn {
    position: relative;
    padding: 0.75rem 1.5rem;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.125rem;
    border-radius: 0;
    margin: 0;
}

.search-btn:hover {
    opacity: 0.9;
    background: linear-gradient(135deg, #5a6dd8 0%, #6a4195 100%);
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 0.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-suggestions.show {
    display: block;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f7fafc;
}

.suggestion-item:hover {
    background: #f7fafc;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-category {
    font-size: 0.75rem;
    color: #a0aec0;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    background: #f7fafc;
    font-weight: 600;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    color: #4a5568;
    text-decoration: none;
}

.action-item:hover {
    background: #f7fafc;
    color: #667eea;
    transform: translateY(-1px);
}

.action-icon {
    font-size: 1.25rem;
}

.action-text {
    font-size: 0.625rem;
    margin-top: 0.125rem;
    font-weight: 500;
}

.badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: #f56565;
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Wallet Section */
.wallet-section {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
}

.connect-btn {
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.connect-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.wallet-connected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wallet-info-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.wallet-info-btn:hover {
    background: white;
    border-color: #667eea;
}

.wallet-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.wallet-address {
    font-size: 0.75rem;
    font-family: monospace;
    color: #4a5568;
}

.kas-balance {
    font-size: 0.875rem;
    font-weight: 600;
    color: #667eea;
}

.profile-icon {
    font-size: 1.25rem;
}

/* Logout Button */
.logout-btn,
.disconnect-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    color: #e53e3e;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.875rem;
}

.logout-btn:hover {
    background: #fed7d7;
    border-color: #fc8181;
    transform: translateY(-1px);
}

.disconnect-btn {
    width: 32px;
    height: 32px;
    justify-content: center;
    padding: 0;
    color: #f56565;
}

.disconnect-btn:hover {
    background: #f56565;
    color: white;
}

.logout-icon {
    font-size: 1rem;
}

.logout-text {
    font-size: 0.875rem;
}

/* Navigation Bar */
.header-nav {
    background: #fafafa;
    border-bottom: 1px solid #e2e8f0;
    padding: 0;
    height: 48px;
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    justify-content: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-btn:hover {
    background: white;
    color: #2d3748;
}

.nav-btn.active {
    background: transparent;
    color: #667eea;
    border-bottom-color: #667eea;
}

.nav-icon {
    font-size: 1rem;
}

/* Dropdown Menus */
.dropdown-menu {
    position: fixed;
    top: 70px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    width: 320px;
    max-height: 400px;
    display: none;
    z-index: 1001;
    overflow: hidden;
}

#notificationsDropdown {
    right: 20px;
}

#helpDropdown {
    right: 80px;
}

.dropdown-menu.show {
    display: block;
    animation: slideDown 0.2s ease;
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.clear-all {
    font-size: 0.75rem;
    color: #667eea;
    background: none;
    border: none;
    cursor: pointer;
}

.dropdown-content {
    max-height: 320px;
    overflow-y: auto;
}

.empty-state {
    padding: 3rem 2rem;
    text-align: center;
    color: #a0aec0;
}

.empty-state span {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.help-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: #4a5568;
    text-decoration: none;
    transition: background 0.2s;
}

.help-item:hover {
    background: #f7fafc;
    color: #667eea;
}

/* ============================================
   4. FILTERS SIDEBAR
============================================ */
.filters {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 118px;
    height: fit-content;
	min-width: 280px;  /* Increased from default */
    width: 280px;      /* Fixed width to prevent layout shifts */
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}

.filters h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.apply-filters-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

/* ============================================
   5. PRODUCTS GRID & CARDS
============================================ */
.products {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card > div:first-child {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 10px;
}

.product-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    min-height: 2.5rem;
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    line-height: 1.4;
    min-height: 3.6rem;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    margin-top: auto;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.product-stock {
    font-size: 0.75rem;
    color: var(--text-color);
}

.product-stock.in-stock {
    color: #007600;
}

.product-stock.out-of-stock {
    color: #cc0c39;
}

.product-stock.low-stock {
    color: #c45500;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
}

.btn-view,
.btn-add-cart {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.btn-view {
    background: var(--light-color);
    color: var(--dark-color);
}

.btn-add-cart {
    background: var(--gradient);
    color: white;
}

/* ============================================
   6. MODALS
============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

.modal-large {
    max-width: 1400px !important;
    width: 95%;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: white;
    z-index: 10;
    position: relative;
}

.modal-header h2 {
    color: var(--dark-color);
    font-size: 1.25rem;
}

.close-modal {
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e7e7e7;
    background: #f0f2f2;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    position: sticky;
    bottom: 0;
}



/* Product Images Section */
.product-images-section {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.main-image-container {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

#modalMainImage {
    width: 100%;
    height: 100%;
    max-height: 500px;
    object-fit: contain;
    cursor: zoom-in;
}

.thumbnail-gallery,
.thumbnails {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
}

.thumbnail-gallery img,
.thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.thumbnail-gallery img:hover,
.thumbnails img:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.thumbnail-gallery img.active,
.thumbnails img.active {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Product Info Section */
.product-info-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-title-section {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
}

#modalProductTitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.product-meta-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: #718096;
}

.product-sku {
    font-family: monospace;
}

/* Price Display */
.product-price-section {
    background: #fff;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.price-label {
    font-size: 0.875rem;
    color: #565959;
}

.price-value {
    font-size: 1.75rem;
    font-weight: 400;
    color: #0f1111;
}

.price-currency {
    font-size: 1rem;
    color: #565959;
    margin-left: 0.25rem;
}

.price-savings {
    font-size: 0.875rem;
    color: #007600;
    margin-top: 0.25rem;
}

/* Product Description */
.product-short-description,
.product-short-desc {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #0f1111;
    padding: 0 1rem;
    max-height: 100px;
    overflow-y: auto;
}

/* Product Options */
.product-options,
#quickViewOptions {
    padding: 0 1rem;
}

.option-group {
    margin-bottom: 1rem;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0f1111;
}

.option-values {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.size-option {
    padding: 0.5rem 1rem;
    border: 1px solid #d5d9d9;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.size-option:hover {
    border-color: #007185;
    background: #f7fafa;
}

.size-option.selected {
    border-color: #007185;
    background: #edfdff;
    box-shadow: 0 0 0 1px #007185;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #d5d9d9;
    position: relative;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    box-shadow: 0 0 0 2px white, 0 0 0 4px #007185;
}

/* Product Actions */
.product-actions {
    background: #f3f3f3;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ============================================
   QUANTITY SELECTOR FIXES
   Add this to your store.css file
============================================ */

/* Hide browser's default number input spinners */
#modalQuantity::-webkit-outer-spin-button,
#modalQuantity::-webkit-inner-spin-button,
.quantity-selector input[type="number"]::-webkit-outer-spin-button,
.quantity-selector input[type="number"]::-webkit-inner-spin-button,
input[type="number"].quantity-input::-webkit-outer-spin-button,
input[type="number"].quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Hide browser's default number spinners */
#modalQuantity::-webkit-outer-spin-button,
#modalQuantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* Ensure the quantity selector container is properly sized */
.quantity-selector,
.quantity-control {
    display: inline-flex !important;
    align-items: center !important;
    background: white !important;
    border: 1px solid #d5d9d9 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    width: auto !important;  /* Let it size to content */
}

/* Firefox */
#modalQuantity[type="number"],
.quantity-selector input[type="number"],
input[type="number"].quantity-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Fix the quantity input width and centering */
#modalQuantity,
.quantity-selector input[type="number"],
.quantity-control input {
    width: 60px !important;  /* Fixed width instead of flex */
    max-width: 60px !important;
    text-align: center !important;
    padding: 0.5rem 0 !important;  /* Remove horizontal padding */
    font-size: 1rem !important;
    font-weight: 500 !important;
    border: none !important;
    border-left: 1px solid #d5d9d9 !important;
    border-right: 1px solid #d5d9d9 !important;
    background: white !important;
    margin: 0 !important;
}

/* Ensure quantity selector is properly styled */
.quantity-selector,
.quantity-control {
    display: inline-flex !important;
    align-items: center !important;
    background: white !important;
    border: 1px solid #d5d9d9 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

/* Style the +/- buttons */
.qty-btn,
.quantity-control button {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;  /* Prevent shrinking */
    border: none !important;
    background: #f7f7f7 !important;
    cursor: pointer !important;
    font-size: 1.25rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s !important;
    color: #555 !important;
    font-weight: 400 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.qty-btn:hover:not(:disabled),
.quantity-control button:hover {
    background: #e0e0e0 !important;
}

.qty-btn:active:not(:disabled),
.quantity-control button:active {
    background: #d0d0d0 !important;
}

/* Ensure proper alignment of the entire row */
.quantity-row,
.product-actions .quantity-row {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    margin-bottom: 1rem !important;
}

.quantity-label {
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    color: #0f1111 !important;
    min-width: 80px !important;
}

.quantity-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-selector-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-selector-group label {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.875rem;
}

.quantity-selector-group .quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--light-color);
    padding: 0.25rem;
    border-radius: 6px;
}



.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


#modalAddToCartBtn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

#modalAddToCartBtn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#modalAddToCartBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Key Features */
.key-features {
    background: #f7fafa;
    padding: 1rem;
    border-radius: 8px;
    margin: 0 1rem;
}

.key-features h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0f1111;
}

.key-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-features li {
    padding: 0.25rem 0;
    padding-left: 1.25rem;
    position: relative;
    font-size: 0.875rem;
    line-height: 1.4;
}

.key-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #067d62;
    font-weight: bold;
}


.tab-headers {
    display: flex;
    background: #f7fafa;
    border-bottom: 1px solid #d5d9d9;
    padding: 0 2rem;
    flex-shrink: 0;
}

.tab-header {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #565959;
    position: relative;
    transition: all 0.2s;
    font-size: 0.9375rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-header:hover {
    color: #007185;
    background: white;
}

.tab-header.active {
    color: #c45500;
    background: white;
    border-bottom-color: #c45500;
}

.tab-contents {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    min-height: 200px;
    max-height: 400px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Specifications Table */
.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #e2e8f0;
}

.specs-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.specs-table td:first-child {
    font-weight: 500;
    color: #565959;
    width: 200px;
    background: #f7fafa;
}

.specs-table td:last-child {
    color: #0f1111;
}

/* Quick View Modal */
.quick-view-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.quick-view-image {
    width: 100%;
}

.quick-view-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--light-color);
}

.quick-view-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-view-price {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1.125rem;
    font-weight: bold;
}

.stock-status {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stock-status.in-stock {
    color: var(--success-color);
}

.stock-status.out-of-stock {
    color: var(--danger-color);
}

.stock-status.low-stock {
    color: var(--warning-color);
}

/* ============================================
   7. FORMS & INPUTS
============================================ */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f1111;
    margin-bottom: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d5d9d9;
    border-radius: 3px;
    font-size: 0.9375rem;
    background: white;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e77600;
    box-shadow: 0 0 0 3px rgba(231, 118, 0, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.form-row:last-child {
    grid-template-columns: 1fr 2fr;
}

.form-section {
    margin-bottom: 1.75rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f1111;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e7e7e7;
}

.readonly-input {
    background-color: #f0f2f2;
    color: #565959;
    cursor: not-allowed;
    font-family: monospace;
    font-size: 0.875rem;
}

.input-with-action {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.input-with-action input {
    flex: 1;
    min-width: 0;
}

/* ============================================
   8. BUTTONS
============================================ */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: #ffd814;
    color: #0f1111;
    border: 1px solid #fcd200;
}

.btn-primary:hover {
    background: #f7ca00;
}

.btn-secondary {
    background: white;
    color: #0f1111;
    border: 1px solid #d5d9d9;
}

.btn-secondary:hover {
    background: #f7f7f7;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 4px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
}

.btn-inline {
    padding: 0.75rem 1.5rem;
    background: #ffd814;
    color: #0f1111;
    border: 1px solid #fcd200;
    border-radius: 3px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.btn-inline:hover {
    background: #f7ca00;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: color 0.2s;
}

.btn-link:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.btn-view-order {
    padding: 0.375rem 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-view-order:hover {
    background: #5a67d8;
}

/* ============================================
   9. CART & CHECKOUT
============================================ */
.cart-items {
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-options {
    margin-top: 0.25rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.option-tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-color);
}

.remove-item {
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-total,
.checkout-total {
    text-align: right;
    padding: 1rem 0;
    border-top: 2px solid var(--border-color);
}

.payment-address {
    font-size: 0.875rem;
    color: var(--text-color);
    margin-top: 0.5rem;
}

.payment-address code {
    background: var(--light-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    word-break: break-all;
}

/* ============================================
   10. PROFILE & ACCOUNT
============================================ */
.profile-container {
    max-width: 100%;
    margin: 0 auto;
}

.account-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profile-content {
    display: grid;
    grid-template-columns: 2fr 1.5fr;
    gap: 2.5rem;
}

.section-card {
    background: white;
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.section-header .section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Orders List */
.orders-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
}

.order-item {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.order-item:hover {
    background: #f8f9fa;
}

.order-item:last-child {
    border-bottom: none;
}

.order-info {
    flex: 1;
}

.order-number {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.order-date {
    font-size: 0.8125rem;
    color: #6c757d;
}

.order-amount {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9375rem;
    margin-right: 1rem;
}

/* Base order status styling */
.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

/* Status-specific colors */
.order-status.pending { background: #fff3cd; color: #856404; }
.order-status.paid { background: #7dd494; color: #1e3a8a; }
.order-status.processing { background: #cce5ff; color: #004085; }
.order-status.shipped { background: #e7c7ff; color: #5a189a; }
.order-status.completed { background: #d4edda; color: #155724; }
.order-status.cancelled { background: #f8d7da; color: #721c24; }
.order-status.failed { background: #f8d7da; color: #721c24; }
.order-status.refunded { background: #e0e0e0; color: #424242; }

.empty-orders {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-orders p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Orders Table */
.orders-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.orders-filters select,
.orders-filters input {
    padding: 0.625rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9375rem;
}

.orders-filters input {
    flex: 1;
}

.orders-table-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table thead {
    background: #f8f9fa;
}

.orders-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.orders-table td {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    color: #212529;
    border-bottom: 1px solid #e9ecef;
}

.orders-table tbody tr:hover {
    background: #f8f9fa;
}

/* ============================================
   11. ORDER CONFIRMATION
============================================ */
.order-confirmation-content {
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.confirmation-animation {
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.success-checkmark {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #4bb71b;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #4bb71b;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.success-checkmark .check-icon {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: white;
    stroke-miterlimit: 10;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

.check-icon .icon-line {
    height: 5px;
    background-color: white;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.check-icon .line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.check-icon .line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

.icon-circle {
    top: -4px;
    left: -4px;
    z-index: 10;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: absolute;
    box-sizing: content-box;
    border: 4px solid rgba(76, 175, 80, .5);
}

.icon-fix {
    top: 8px;
    width: 5px;
    left: 26px;
    z-index: 1;
    height: 85px;
    position: absolute;
    transform: rotate(-45deg);
    background-color: white;
}

.confirmation-header {
    text-align: center;
    padding: 1rem;
}

.confirmation-header h2 {
    color: #4bb71b;
    margin-bottom: 0.5rem;
}

.confirmation-section {
    padding: 1rem 1.5rem;
}

.confirmation-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
}

.confirmation-items {
    background: #transparent;
    border-radius: 8px;
    padding: 1rem;
}

.confirmation-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.confirmation-item:last-child {
    margin-bottom: 0;
}

.confirmation-item-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8f9fa;
    padding: 4px;
}

.confirmation-item-details {
    flex: 1;
}

.confirmation-item-name {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.confirmation-item-qty {
    font-size: 0.875rem;
    color: #718096;
}

.confirmation-item-price {
    font-weight: 600;
    color: #667EEA;
    white-space: nowrap;
}

.shipping-info-card,
.payment-info-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.shipping-info-card address {
    font-style: normal;
    color: #4a5568;
}

.payment-info-card .payment-method {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.payment-info-card .transaction-id {
    font-family: monospace;
    font-size: 0.75rem;
    color: #718096;
    word-break: break-all;
}

.order-summary-card {
    background: white;
    color: #2D3748;
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}


.order-summary-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    margin: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.summary-row.total {
    border-top: 2px solid #667EEA;
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.confirmation-footer {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    border-top: 1px solid #e2e8f0;
}

.confirmation-footer button {
    min-width: 150px;
}

/* ============================================
   12. UTILITIES
============================================ */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 40px;
}

.pagination button:hover {
    background: var(--light-color);
}

.pagination button.active {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: 20px;
    max-width: 400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: none;
    animation: slideUp 0.3s;
    z-index: 2000;
}

.notification.show {
    display: block;
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

/* ============================================
   13. ANIMATIONS
============================================ */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #4bb71b;
    }
}

@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes icon-line-tip {
    0% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    54% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    70% {
        width: 50px;
        left: -8px;
        top: 37px;
    }
    84% {
        width: 17px;
        left: 21px;
        top: 48px;
    }
    100% {
        width: 25px;
        left: 14px;
        top: 45px;
    }
}

@keyframes icon-line-long {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    84% {
        width: 55px;
        right: 0px;
        top: 35px;
    }
    100% {
        width: 47px;
        right: 8px;
        top: 38px;
    }
}

/* ============================================
   14. RESPONSIVE DESIGN
============================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1200px) {
    .modal-large {
        max-width: 95%;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .main-content .container {
        grid-template-columns: 200px 1fr;
        gap: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .header-content {
        gap: 0.75rem;
    }
    
    .search-section {
        max-width: 400px;
    }
    
    .action-text,
    .logout-text {
        display: none;
    }
    
    .nav-menu {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none;
    }
    
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .product-images-section {
        max-width: 500px;
    }
}

@media (max-width: 992px) {
    .profile-content {
        grid-template-columns: 1fr;
    }
    
    .account-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (320px - 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Header Mobile */
    .header {
        position: fixed;
        width: 100%;
        box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    }
    
    .header-main,
    .header-top {
        padding: 0.75rem 0;
    }
    
	.header-content,
	.header-top-content {
		display: flex;
		align-items: center;
		justify-content: space-between; /* Add this */
		gap: 2rem;
		height: 60px;
	}
    
    .logo-text h1 {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        font-size: 2rem;
    }
    
    .search-section {
        order: 3;
        flex-basis: 100%;
        max-width: 100%;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .nav-btn {
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }
    
    .main-content {
        padding-top: 160px;
    }
    
    .main-content .container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Hide desktop filters */
    .filters {
        display: none;
    }
    
    /* Products Mobile */
    .products {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .product-card {
        border-radius: 8px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-content {
        padding: 0.75rem;
    }
    
    .product-title {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }
    
    .product-description {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .product-stock {
        font-size: 0.625rem;
    }
    
    .product-actions {
        gap: 0.375rem;
    }
    
    .btn-view,
    .btn-add-cart {
        padding: 0.375rem;
        font-size: 0.75rem;
    }
    
    /* Modal Mobile */
    .modal {
        padding: 0;
    }
    
    .modal-content {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    
    .modal-header {
        padding: 1rem;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-bottom: 2px solid var(--border-color);
    }
    
    .modal-header h2 {
        font-size: 1.125rem;
    }
    
    .close-modal {
        font-size: 1.75rem;
        padding: 0.75rem;
    }
    
    .modal-body {
        padding: 1rem;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-footer {
        padding: 1rem;
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 2px solid var(--border-color);
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    /* Product Detail Mobile */
    #productModal .modal-header {
        padding: 1rem;
    }
    
    .product-detail-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1.5rem;
    }
    
    #modalMainImage {
        max-height: 300px;
    }
    
    .tab-headers {
        padding: 0 1rem;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-contents {
        padding: 1rem;
    }
    
    .price-value {
        font-size: 1.5rem;
    }
    
    .quick-view-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .quick-view-image img {
        height: 150px;
    }
    
    /* Form Mobile */
    .form-row {
        grid-template-columns: 1fr !important;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.625rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .input-with-action {
        flex-direction: column;
    }
    
    .input-with-action input {
        width: 100%;
    }
    
    .btn-inline {
        width: 100%;
    }
    
    /* Cart Mobile */
    .cart-items {
        max-height: 50vh;
    }
    
    .cart-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .cart-item img {
        width: 50px;
        height: 50px;
    }
    
    .cart-item-name {
        font-size: 0.875rem;
    }
    
    .cart-item-price {
        font-size: 0.875rem;
    }
    
    .quantity-control button {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    /* Buttons Mobile */
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Pagination Mobile */
    .pagination {
        padding: 1rem 0;
    }
    
    .pagination button {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
        min-width: 36px;
    }
    
    /* Notification Mobile */
    .notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Loading Spinner Mobile */
    .loading-spinner {
        padding: 2rem;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
    }
    
    /* Dropdown Mobile */
    .dropdown-menu {
        width: calc(100vw - 40px);
        right: 20px !important;
    }
    
    /* Profile Mobile */
    .account-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-content {
        grid-template-columns: 1fr;
    }
    
    .orders-filters {
        flex-direction: column;
    }
    
    .orders-table {
        font-size: 0.875rem;
    }
    
    .orders-table th,
    .orders-table td {
        padding: 0.625rem 0.5rem;
    }
    
    /* Hide less important columns on mobile */
    .orders-table th:nth-child(3),
    .orders-table td:nth-child(3) {
        display: none;
    }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-card {
        display: flex;
        gap: 1rem;
    }
    
    .product-image {
        width: 100%;
        height: 200px;
        object-fit: contain;
        background: var(--light-color);
    }
    
    .product-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .header-content {
        padding: 0.5rem 0;
    }
    
    .logo h1 {
        font-size: 1.125rem;
    }
    
    .nav-btn {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .cart-item {
        flex-wrap: wrap;
    }
    
    .cart-item-info {
        width: 100%;
        order: 2;
    }
    
    .cart-item-actions {
        width: 100%;
        order: 3;
        justify-content: space-between;
    }
}

/* Landscape Mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .header {
        position: relative;
    }
    
    .main-content {
        padding-top: 1rem;
    }
    
    .modal-content {
        max-height: 90vh;
        border-radius: 12px;
        margin: 1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-image {
        height: 120px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    button,
    .btn-primary,
    .btn-secondary,
    .nav-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .nav-btn:hover {
        background: transparent;
    }
    
    .nav-btn:active {
        background: var(--light-color);
    }
    
    button:active,
    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.98);
    }
    
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    button,
    .btn-primary,
    .btn-secondary,
    .nav-btn {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid var(--dark-color);
    }
    
    button,
    .btn-primary,
    .btn-secondary {
        border: 2px solid currentColor;
    }
}

/* Price display with USD */
.price-display {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.product-price-usd {
    font-size: 0.75rem;
    color: #718096;
    font-weight: normal;
}

/* For modal and other price displays */
.price-with-usd {
    display: inline-flex;
    flex-direction: column;
    gap: 0.125rem;
}

.price-usd-small {
    font-size: 0.875rem;
    color: #718096;
    font-weight: normal;
    opacity: 0.9;
}

/* Hide USD prices when toggled off */
.hide-usd-prices .product-price-usd,
.hide-usd-prices .price-usd-small {
    display: none !important;
}

.currency-toggle {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 8px;
}

/* Product card manufacturer */
.product-manufacturer {
    font-size: 0.8125rem;
    color: #718096;
    margin: -0.25rem 0 0.5rem 0;
    font-style: italic;
}

/* Modal manufacturer */
.product-manufacturer-modal {
    font-size: 1rem;
    color: #718096;
    margin: 0.25rem 0 1rem 0;
    font-style: italic;
}

/* ===== ADD THESE STYLES TO YOUR store.css ===== */

/* Enhanced Search Box with Department Selector */
.search-box-enhanced {
    display: flex;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: 600px;
}

/* Department Selector */
.dept-selector {
    position: relative;
    border-right: 1px solid #e0e0e0;
}

.dept-selector-btn {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 160px;
    font-size: 0.875rem;
    color: #333;
    transition: background 0.2s;
}

.dept-selector-btn:hover {
    background: #e9ecef;
}

.dept-selector-btn .arrow-down {
    margin-left: auto;
    font-size: 0.75rem;
    color: #666;
    transition: transform 0.2s;
}

.dept-dropdown.show + .dept-selector-btn .arrow-down {
    transform: rotate(180deg);
}

/* Department Dropdown */
.dept-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dept-dropdown.show {
    display: block;
}

.dept-dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.dept-dropdown-item:last-child {
    border-bottom: none;
}

.dept-dropdown-item:hover {
    background: #f8f9fa;
}

.dept-dropdown-item.active {
    background: #e7f3ff;
    color: #0066cc;
}

.dept-dropdown-item i {
    width: 20px;
    text-align: center;
    color: #666;
}

.dept-dropdown-item.active i {
    color: #0066cc;
}

.dept-dropdown-item .count {
    margin-left: auto;
    background: #e0e0e0;
    color: #666;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* Update search input to work with new container */
.search-box-enhanced #searchInput {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    font-size: 0.95rem;
    outline: none;
}

.search-box-enhanced .search-btn {
    padding: 0.75rem 1.25rem;
    background: #ff6600;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.search-box-enhanced .search-btn:hover {
    background: #e55a00;
}

/* More Departments Dropdown in Nav */
.nav-more {
    position: relative;
}



.more-departments-dropdown.show {
    display: block;
}


/* Department Filter in Sidebar */
.department-filter {
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
    margin-top: 1rem;
}

.dept-filter-list {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.dept-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 4px;
}

.dept-checkbox:hover {
    background: #f8f9fa;
}

.dept-checkbox input[type="radio"] {
    margin-right: 0.5rem;
}

.dept-checkbox span {
    flex: 1;
}

.dept-checkbox .count {
    color: #666;
    font-size: 0.875rem;
    margin-left: 0.25rem;
}

/* Product Card Department Badge */
.product-department {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-department i {
    font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-box-enhanced {
        flex-direction: column;
        border-radius: 8px;
    }
    
    .dept-selector {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .dept-selector-btn {
        width: 100%;
        justify-content: space-between;
    }
    
    .dept-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 50vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    }
    
    .nav-menu {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Hide less important nav items on mobile */
    .nav-btn:nth-child(n+5) {
        display: none;
    }
    
    .nav-more {
        display: flex !important;
    }
}

/* Loading state for departments */
.departments-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.departments-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #ff6600;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Department Links in Sidebar */
.department-filter {
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
    margin-top: 1rem;
}

.department-filter label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.dept-filter-list {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
}

.dept-filter-list::-webkit-scrollbar {
    width: 6px;
}

.dept-filter-list::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.dept-filter-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.dept-filter-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Department Links */
.dept-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.dept-link:hover {
    background: #f7fafc;
    color: #2d3748;
    padding-left: 1rem;
}

.dept-link.active {
    background: #667eea;
    color: white;
    font-weight: 500;
}

.dept-link.active:hover {
    background: #5a67d8;
}

.dept-link i {
    width: 16px;
    text-align: center;
    font-size: 0.875rem;
}

.dept-link .count {
    margin-left: auto;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.dept-link.active .count {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

/* Product Card Department Badge */
.product-department {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #4a5568;
}

.product-department i {
    font-size: 0.875rem;
}

/* Notification Styles */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    font-size: 0.95rem;
}

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

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: #718096;
    font-size: 1.1rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 2rem;
    color: #e53e3e;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #718096;
    grid-column: 1 / -1;
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .department-filter {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e0e0e0;
        border-radius: 16px 16px 0 0;
        padding: 1rem;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .department-filter.show {
        transform: translateY(0);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }
    
    /* Add a toggle button for mobile */
    .dept-filter-toggle {
        display: block;
        position: fixed;
        bottom: 20px;
        left: 20px;
        background: #667eea;
        color: white;
        padding: 0.75rem 1rem;
        border-radius: 50px;
        border: none;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        font-weight: 500;
        cursor: pointer;
        z-index: 999;
    }
    
    .dept-link {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
}

@media (min-width: 769px) {
    .dept-filter-toggle {
        display: none;
    }
}

/* Department Links in Filters Section - cool Style */
.dept-filter-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    min-height: 36px;  /* Ensure consistent height */
}

.dept-filter-link:hover {
    background: #f7fafc;
    color: #2d3748;
    padding-left: 1rem;
}

.dept-filter-link.active {
    background: #667eea;
    color: white;
    font-weight: 500;
}

.dept-filter-link.active:hover {
    background: #5a67d8;
}

.dept-filter-link i {
    width: 16px;
    flex-shrink: 0;
    margin-right: 0.25rem;
    text-align: center;
}

/* Department name - prevent wrapping for consistency */
.dept-filter-link span {
    flex: 1;
    white-space: nowrap;  /* Prevent wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 0.5rem;
}

/* Show full name on hover via tooltip for truncated names */
.dept-filter-link:hover span[title] {
    position: relative;
}

.dept-filter-link span[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    background: #2d3748;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: none;
}

/* Product count - keep aligned */
.dept-filter-link small {
    flex-shrink: 0;
    opacity: 0.7;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Fix for More dropdown positioning */
.nav-more {
    position: relative;
}

.more-departments-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 0.5rem;
}

.more-departments-dropdown.show {
    display: block;
}

.more-dept-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.more-dept-item:last-child {
    border-bottom: none;
}

.more-dept-item:hover {
    background: #f8f9fa;
}

/* Mobile responsive - adjust width on smaller screens */
@media (max-width: 1200px) {
    .filters {
        min-width: 250px;
        width: 250px;
    }
    
    .main-content .container {
        grid-template-columns: 250px 1fr;
    }
}

@media (max-width: 768px) {
    .filters {
        display: none;  /* Hide on mobile, could be toggle-able */
    }
    
    .main-content .container {
        grid-template-columns: 1fr;
    }
}

/* More dropdown positioning fix */
.header-nav .container {
    position: relative;  /* Make this the positioning context */
}

.more-departments-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 0.5rem;
}


.more-dept-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.more-dept-item:last-child {
    border-bottom: none;
}

.more-dept-item:hover {
    background: #f8f9fa;
}

.more-dept-item i {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.more-dept-item span {
    flex: 1;
}

/* Ensure More button looks clickable */
.nav-btn.nav-more {
    cursor: pointer;
    position: relative;
}

.nav-btn.nav-more:hover {
    background: white;
    color: #2d3748;
}

/* ============================================
   Admin Panel Stylesheet
============================================ */

.admin-header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    padding: 1rem 0;
}

.admin-header .logo h1 {
    color: white;
    font-size: 1.5rem;
}

.back-to-store {
    color: #cbd5e0;
    text-decoration: none;
    font-size: 0.875rem;
    margin-left: 1rem;
}

.back-to-store:hover {
    color: white;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

/* Admin Layout */
.admin-main {
    min-height: calc(100vh - 80px);
    background: #f7fafc;
    padding: 2rem 0;
}

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

/* Admin Sidebar */
.admin-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    height: fit-content;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-nav-btn {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.admin-nav-btn:hover {
    background: var(--light-color);
}

.admin-nav-btn.active {
    background: var(--gradient);
    color: white;
}

/* Admin Content */
.admin-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: var(--dark-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    color: black;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.stat-card h3 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chart-container {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 12px;
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters-bar input,
.filters-bar select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
}

.filters-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.admin-table thead {
    background: var(--light-color);
}

.admin-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.875rem;
}

.admin-table td {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.admin-table tbody tr:hover {
    background: var(--light-color);
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit, .btn-delete, .btn-view {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-edit {
    background: var(--primary-color);
    color: white;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

.btn-view {
    background: #C0C0C0;
    color: white;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.processing {
    background: #cce5ff;
    color: #004085;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Order Details */
#orderDetails, #refundDetails {
    background: var(--light-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

#orderDetails h4, #refundDetails h4 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

#orderDetails p, #refundDetails p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-main .container {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        display: none;
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .admin-table {
        font-size: 0.75rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }
}

/* Add this to your admin.css file */

/* Modal Enhancements */
.modal-large {
    max-width: 900px;
    width: 90%;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #718096;
    position: relative;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #2d3748;
}

.tab-btn.active {
    color: #667eea;
}

.tab-btn.active:after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Attributes Section */
.attributes-section {
    max-height: 500px;
    overflow-y: auto;
}

.attribute-group {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.attribute-group h4 {
    margin-bottom: 1rem;
    color: #2d3748;
    font-size: 1rem;
}

.attribute-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.attribute-item input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.875rem;
}

.attribute-item input[type="number"] {
    flex: 0 0 80px;
}

.new-attribute {
    animation: slideIn 0.3s ease;
}

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

.btn-delete-small {
    padding: 0.25rem 0.5rem;
    background: #f56565;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-small:hover {
    background: #e53e3e;
}

.btn-small {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-small:hover {
    background: #5a67d8;
}

.no-attributes {
    color: #a0aec0;
    font-style: italic;
    padding: 0.5rem;
}

.help-text {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.25rem;
}

.current-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.current-images img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
}

.current-images .main-image {
    border-color: #667eea;
}

/* ============================================
   Admin Panel Stylesheet
============================================ */

.admin-header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    padding: 1rem 0;
}

.admin-header .logo h1 {
    color: white;
    font-size: 1.5rem;
}

.back-to-store {
    color: #cbd5e0;
    text-decoration: none;
    font-size: 0.875rem;
    margin-left: 1rem;
}

.back-to-store:hover {
    color: white;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

/* Admin Layout */
.admin-main {
    min-height: calc(100vh - 80px);
    background: #f7fafc;
    padding: 2rem 0;
}

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

/* Admin Sidebar */
.admin-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    height: fit-content;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-nav-btn {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.admin-nav-btn:hover {
    background: var(--light-color);
}

.admin-nav-btn.active {
    background: var(--gradient);
    color: white;
}

/* Admin Content */
.admin-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: var(--dark-color);
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chart-container {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 12px;
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters-bar input,
.filters-bar select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
}

.filters-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.admin-table thead {
    background: var(--light-color);
}

.admin-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.875rem;
}

.admin-table td {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.admin-table tbody tr:hover {
    background: var(--light-color);
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit, .btn-delete, .btn-view {
	background: #C0C0C0;
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-edit {
    background: var(--primary-color);
    color: white;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.processing {
    background: #cce5ff;
    color: #004085;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Order Details */
#orderDetails, #refundDetails {
    background: var(--light-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

#orderDetails h4, #refundDetails h4 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

#orderDetails p, #refundDetails p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-main .container {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        display: none;
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .admin-table {
        font-size: 0.75rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }
}

/* Add this to your admin.css file */

/* Modal Enhancements */
.modal-large {
    max-width: 900px;
    width: 90%;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #718096;
    position: relative;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #2d3748;
}

.tab-btn.active {
    color: #667eea;
}

.tab-btn.active:after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Attributes Section */
.attributes-section {
    max-height: 500px;
    overflow-y: auto;
}

.attribute-group {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.attribute-group h4 {
    margin-bottom: 1rem;
    color: #2d3748;
    font-size: 1rem;
}

.attribute-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.attribute-item input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.875rem;
}

.attribute-item input[type="number"] {
    flex: 0 0 80px;
}

.new-attribute {
    animation: slideIn 0.3s ease;
}

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

.btn-delete-small {
    padding: 0.25rem 0.5rem;
    background: #f56565;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-small:hover {
    background: #e53e3e;
}

.btn-small {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-small:hover {
    background: #5a67d8;
}

.no-attributes {
    color: #a0aec0;
    font-style: italic;
    padding: 0.5rem;
}

.help-text {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.25rem;
}

.current-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.current-images img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
}

.current-images .main-image {
    border-color: #667eea;
}

/* Ensure modal backdrop covers entire screen */
#productModal.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}


#productModal.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem; /* Add padding around modal */
}

#productModal.modal.show {
    display: flex;
}

/* Ensure proper padding for modal sections */
#productModal .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

#productModal .modal-body {
    padding: 1.5rem;
    background: white;
}

#productModal .modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Fix tab panel padding */
#productModal .tab-panel {
    padding: 1rem 0;
}

#productModal .form-group {
    margin-bottom: 1rem;
}

#productModal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2d3748;
    font-size: 0.875rem;
}

#productModal .form-group input,
#productModal .form-group select,
#productModal .form-group textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

#productModal .form-group input:focus,
#productModal .form-group select:focus,
#productModal .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Fix form row spacing */
#productModal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Modal tabs styling */
#productModal .modal-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #e2e8f0;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem; /* Extend to edges */
    padding: 0 1.5rem;
    background: #f8f9fa;
}

#productModal .tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #718096;
    position: relative;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

#productModal .tab-btn:hover {
    color: #2d3748;
}

#productModal .tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Image Management */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.image-item {
    position: relative;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    cursor: move;
    transition: all 0.3s;
}

.image-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.image-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.image-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.main-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem;
    font-size: 0.625rem;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.image-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-item:hover .image-actions {
    opacity: 1;
}

.btn-reorder {
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: grab;
    font-size: 0.875rem;
}

.btn-reorder:active {
    cursor: grabbing;
}

.btn-delete-img {
    background: #f56565;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.btn-delete-img:hover {
    background: #e53e3e;
}

.no-images {
    color: #a0aec0;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}


/* Departments Section */
#departmentsSection {
    padding: 2rem;
}

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

/* Department Table Specific */
#departmentsTable .drag-handle {
    cursor: move;
    color: #999;
}

#departmentsTable .drag-handle:hover {
    color: #333;
}

#departmentsTable tr.dragging {
    opacity: 0.5;
    background: #f0f0f0;
}

#departmentsTable .dept-icon {
    text-align: center;
    font-size: 1.25rem;
    color: #666;
}

#departmentsTable .dept-icon i {
    color: #007bff;
}

/* Department Modal */
#departmentModal .modal-content {
    max-width: 600px;
}

.icon-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.icon-selector input {
    flex: 1;
}

.icon-preview {
    width: 50px;
    height: 50px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: #f8f9fa;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.icon-option {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-size: 1.25rem;
}

.icon-option:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.icon-option.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Department Badge in Product Table */
.product-dept-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.875rem;
}

.product-dept-badge i {
    font-size: 0.875rem;
}

/* Empty state for departments */
#departmentsSection .empty-state {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 2rem;
}

#departmentsSection .empty-state i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

#departmentsSection .empty-state p {
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Drag and drop visual feedback */
.drag-over {
    background: #e7f3ff;
}

.order-num {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.375rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Product form department dropdown - update existing */
#productDepartment {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 0.95rem;
}

/* Department filter in products */
#productDeptFilter {
    width: 200px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .icon-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .departments-stats {
        grid-template-columns: 1fr;
    }
}

   /* Messaging Modal Styles */
    .messaging-modal {
        display: none;
        position: fixed;
        z-index: 10000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        animation: fadeIn 0.3s;
    }
    
    .messaging-modal.show {
        display: block;
    }
    
    .messaging-content {
        background-color: #fff;
        margin: 50px auto;
        padding: 0;
        border-radius: 12px;
        width: 90%;
        max-width: 600px;
        max-height: 80vh;
        display: flex;
        flex-direction: column;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    }
    
    .messaging-header {
        padding: 20px;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-radius: 12px 12px 0 0;
    }
    
    .messaging-header h3 {
        margin: 0;
        font-size: 1.25rem;
    }
    
    .messaging-close {
        color: white;
        font-size: 28px;
        font-weight: bold;
        cursor: pointer;
        background: none;
        border: none;
        opacity: 0.8;
    }
    
    .messaging-close:hover {
        opacity: 1;
    }
    
    .messaging-body {
        padding: 20px;
        overflow-y: auto;
        flex-grow: 1;
    }
    
    .message-thread-container {
        max-height: 400px;
        overflow-y: auto;
        padding: 15px;
        background: #f8f9fa;
        border-radius: 8px;
        margin-bottom: 15px;
    }
    
    .message-item {
        margin-bottom: 15px;
        display: flex;
    }
    
    .message-item.own {
        justify-content: flex-end;
    }
    
    .message-item.other {
        justify-content: flex-start;
    }
    
    .message-bubble {
        max-width: 70%;
        padding: 10px 15px;
        border-radius: 18px;
        position: relative;
    }
    
    .message-item.own .message-bubble {
        background: #667eea;
        color: white;
    }
    
    .message-item.other .message-bubble {
        background: #e2e8f0;
        color: #2d3748;
    }
    
    .message-time {
        font-size: 0.75rem;
        opacity: 0.7;
        margin-top: 5px;
    }
    
    .message-compose {
        display: flex;
        gap: 10px;
        margin-top: 15px;
    }
    
    .message-input {
        flex-grow: 1;
        padding: 10px;
        border: 1px solid #e2e8f0;
        border-radius: 25px;
        outline: none;
    }
    
    .message-send-btn {
        padding: 10px 25px;
        background: #667eea;
        color: white;
        border: none;
        border-radius: 25px;
        cursor: pointer;
        font-weight: 500;
    }
    
    .message-send-btn:hover {
        background: #5a67d8;
    }
    
    .message-notification-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background: #ef4444;
        color: white;
        border-radius: 50%;
        padding: 2px 6px;
        font-size: 0.7rem;
        font-weight: bold;
        min-width: 18px;
        text-align: center;
    }
    
    /* Thread list styles */
    .thread-list {
        max-height: 500px;
        overflow-y: auto;
    }
    
    .thread-item {
        padding: 15px;
        border-bottom: 1px solid #e2e8f0;
        cursor: pointer;
        transition: background 0.2s;
    }
    
    .thread-item:hover {
        background: #f8f9fa;
    }
    
    .thread-item.unread {
        background: #f0f9ff;
        border-left: 3px solid #667eea;
    }
    
    .thread-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 5px;
    }
    
    .thread-name {
        font-weight: 600;
        color: #2d3748;
    }
    
    .thread-time {
        font-size: 0.85rem;
        color: #718096;
    }
    
    .thread-preview {
        color: #718096;
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .thread-badge {
        display: inline-block;
        background: #ef4444;
        color: white;
        border-radius: 10px;
        padding: 2px 8px;
        font-size: 0.75rem;
        margin-left: 8px;
    }
	
/* ============================================ */
/* MESSAGING SYSTEM STYLES - Works for both customer and admin */
/* ============================================ */

/* Modal Base */
.messaging-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.messaging-modal.show {
    display: block;
}

.messaging-content {
    background-color: var(--bg-primary, #fff);
    margin: 50px auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.messaging-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: white;
    border-radius: 12px 12px 0 0;
}

.messaging-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.messaging-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    opacity: 0.8;
    line-height: 1;
    padding: 0;
}

.messaging-close:hover {
    opacity: 1;
}

.messaging-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Message Thread */
.message-thread-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    margin-bottom: 15px;
}

.message-item {
    margin-bottom: 15px;
    display: flex;
}

.message-item.own {
    justify-content: flex-end;
}

.message-item.other {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
}

.message-item.own .message-bubble {
    background: var(--primary-color, #667eea);
    color: white;
}

.message-item.other .message-bubble {
    background: var(--message-other-bg, #e2e8f0);
    color: var(--text-primary, #2d3748);
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 5px;
}

/* Message Compose */
.message-compose {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.message-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 25px;
    outline: none;
    background: var(--input-bg, #fff);
    color: var(--text-primary, #333);
}

.message-input:focus {
    border-color: var(--primary-color, #667eea);
}

.message-send-btn {
    padding: 10px 25px;
    background: var(--primary-color, #667eea);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.message-send-btn:hover {
    background: var(--primary-hover, #5a67d8);
}

/* Notification Badge */
.message-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color, #ef4444);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

/* Thread List */
.thread-list {
    max-height: 500px;
    overflow-y: auto;
}

.thread-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    cursor: pointer;
    transition: background 0.2s;
}

.thread-item:hover {
    background: var(--hover-bg, #f8f9fa);
}

.thread-item.unread {
    background: var(--unread-bg, #f0f9ff);
    border-left: 3px solid var(--primary-color, #667eea);
}

.thread-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.thread-name {
    font-weight: 600;
    color: var(--text-primary, #2d3748);
}

.thread-time {
    font-size: 0.85rem;
    color: var(--text-secondary, #718096);
}

.thread-preview {
    color: var(--text-secondary, #718096);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-badge {
    display: inline-block;
    background: var(--danger-color, #ef4444);
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* Support Button */
.btn-support {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color, #667eea);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s;
    z-index: 1000;
}

.btn-support:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .messaging-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .btn-support {
        bottom: 10px;
        right: 10px;
        padding: 12px 20px;
    }
}	
/* Orders History Modal - Fixed height with proper scrolling */
#ordersHistoryModal .modal-content {
    width: 90%;
    max-width: 900px;
    height: 85vh; /* Use viewport height for better responsiveness */
    max-height: 800px; /* Increased max height */
    min-height: 600px; /* Ensure minimum height */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#ordersHistoryModal .modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.5rem;
    min-height: 0; /* Important for flexbox children */
}

/* Filters section - fixed height */
#ordersHistoryModal .orders-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-shrink: 0; /* Don't let filters shrink */
}

#ordersHistoryModal .orders-table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Important for flex item to shrink */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    margin-bottom: 1rem; /* Space before pagination */
}

/* Ensure the table takes full width */
#ordersHistoryModal table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

#ordersHistoryModal thead {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
    border-bottom: 2px solid #dee2e6;
}

#ordersHistoryModal thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

#ordersHistoryModal tbody tr {
    border-bottom: 1px solid #dee2e6;
}

#ordersHistoryModal tbody td {
    padding: 1rem;
    vertical-align: middle;
}

#ordersHistoryModal tbody tr.empty-row {
    pointer-events: none;
}

#ordersHistoryModal tbody tr.empty-row:hover {
    background-color: transparent;
}

#ordersHistoryModal tbody tr.clickable-row:hover {
    background-color: #f5f5f5;
    transition: background-color 0.2s;
    cursor: pointer;
}

/* Pagination area - always visible at bottom */
#ordersHistoryModal #ordersPagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    min-height: 50px;
    flex-shrink: 0; /* Never shrink */
    border-top: 1px solid #e0e0e0;
    background: white;
    margin-top: auto; /* Push to bottom */
}

#ordersHistoryModal .pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}

#ordersHistoryModal .pagination-btn:hover:not(.disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

#ordersHistoryModal .pagination-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

#ordersHistoryModal .pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

/* Custom scrollbar for the table container */
#ordersHistoryModal .orders-table-container::-webkit-scrollbar {
    width: 8px;
}

#ordersHistoryModal .orders-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#ordersHistoryModal .orders-table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#ordersHistoryModal .orders-table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal header styling */
#ordersHistoryModal .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

#ordersHistoryModal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

#ordersHistoryModal .close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#ordersHistoryModal .close-modal:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-height: 700px) {
    #ordersHistoryModal .modal-content {
        height: 90vh;
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    #ordersHistoryModal .modal-content {
        width: 95%;
        height: 90vh;
    }
    
    #ordersHistoryModal .orders-filters {
        flex-direction: column;
    }
    
    #ordersHistoryModal thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    #ordersHistoryModal tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Force override all previous modal rules with !important */
#productModal.modal {
    padding: 0 !important;
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.5) !important;
    z-index: 1000 !important;
    align-items: flex-end !important; /* Align to bottom */
    justify-content: center !important;
}

#productModal.modal.show {
    display: flex !important;
}

/* Main modal content - slides up from bottom */
#productModal .modal-content {
    position: fixed !important;
    top: auto !important; /* Remove top positioning */
    bottom: 0 !important; /* Stick to bottom */
    left: 0 !important;
    right: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    height: calc(100vh - 108px) !important; /* Full height minus header */
    background: white !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    margin: 0 !important;
    transform: translateY(0) !important;
    animation: slideUpFromBottom 0.3s ease !important;
}

/* Closing animation */
#productModal.modal:not(.show) .modal-content {
    animation: slideDownToBottom 0.3s ease !important;
}

/* Animations */
@keyframes slideUpFromBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideDownToBottom {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

/* Ensure proper layout inside modal */
#productModal .modal-header {
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background: white !important;
}

#productModal .modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

#productModal .product-detail-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 3rem !important;
    padding: 2rem !important;
    min-height: 400px !important;
    flex-shrink: 0 !important;
}

#productModal .product-tabs {
    background: white !important;
    border-top: 1px solid #e2e8f0 !important;
    margin-top: auto !important;
    min-height: 300px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #productModal .modal-content {
        height: calc(100vh - 60px) !important; /* Smaller header on mobile */
    }
    
    #productModal .product-detail-grid {
        grid-template-columns: 1fr !important;
        padding: 1rem !important;
        gap: 1.5rem !important;
    }
}

/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    position: relative;
    transition: transform 0.3s;
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    padding: 0 5px;
}

.chat-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
}

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

.chat-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h4 {
    margin: 0;
    font-size: 16px;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
}

.chat-close:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.support {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
}

.chat-message.user .chat-bubble {
    background: #667eea;
    color: white;
}

.chat-message.support .chat-bubble {
    background: white;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.chat-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

#chatInput {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    outline: none;
}

.chat-send-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
}

.chat-send-btn:hover {
    background: #5a67d8;
}

/* Loading state */
.chat-loading {
    text-align: center;
    padding: 20px;
    color: #718096;
}

/* Empty state */
.chat-empty {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.chat-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .chat-box {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
    }
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: #34d399;
    color: white;
    border-radius: 20px;
    font-size: 14px;
    margin-left: 10px;
    font-weight: 500;
    vertical-align: middle;
}

/* Button loading state styles */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading .btn-text {
    opacity: 0;
}

/* Spinner styles */
.btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    display: none;
}

.btn-loading .btn-spinner {
    display: block;
}

.btn-spinner::after {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spinner-rotate 0.6s linear infinite;
}

@keyframes spinner-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Announcement Modal Styles */
.announcement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.announcement-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.announcement-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

.announcement-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.announcement-title i {
    font-size: 1.1rem;
}

.announcement-header .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.announcement-header .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.announcement-body {
    padding: 2rem;
}

.announcement-message {
    margin: 0;
    line-height: 1.6;
    color: var(--text-primary, #374151);
    white-space: pre-wrap;
    font-size: 1rem;
}

.announcement-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    justify-content: flex-end;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 0 0 12px 12px;
}

.announcement-footer .btn {
    padding: 0.625rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.announcement-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .announcement-content {
        width: 95%;
        margin: 1rem;
    }
    
    .announcement-header,
    .announcement-body,
    .announcement-footer {
        padding: 1rem;
    }
    
    .announcement-title {
        font-size: 1.1rem;
    }
    
    .announcement-message {
        font-size: 0.95rem;
    }
}

.notification-item.broadcast-announcement {
    background: linear-gradient(135deg, #f0f4ff 0%, #f9f9ff 100%);
    border-left: 3px solid #667eea;
}

/* In your store.css or admin.css */
.notification-item.unread {
    background-color: #ffffff;
    font-weight: 500;
    border-left: 3px solid #3b82f6;
}

.notification-item.read,
.notification-item:not(.unread) {
    background-color: #f9fafb;
    font-weight: normal;
    opacity: 0.8;
    border-left: 3px solid transparent;
}

.notification-item.unread:hover {
    background-color: #f3f4f6;
}

.notification-item.read:hover {
    background-color: #e5e7eb;
}
