/* --- MODERN CSS VARIABLES --- */
:root {
  /* Palette - Premium Modern */
  --primary: #4f46e5; /* Indigo 600 */
  --primary-dark: #3730a3; /* Indigo 800 */
  --primary-light: #e0e7ff; /* Indigo 100 */
  
  --accent: #06b6d4; /* Cyan 500 */
  
  --secondary: #64748b; /* Slate 500 */
  --secondary-dark: #1e293b; /* Slate 800 */
  
  --bg-body: #f8fafc; /* Slate 50 */
  --bg-card: #ffffff;
  
  --text-main: #0f172a; /* Slate 900 */
  --text-muted: #64748b; /* Slate 500 */
  
  --danger: #ef4444;
  --success: #10b981;
  
  /* UI Elements */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);
  
  --font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
}

/* --- RESET & BASE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: none;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, #f6f8fc 0%, #eef2ff 100%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  /* Add padding for fixed header and footer */
  /* padding-top: 120px;  */
  padding-bottom: 140px;
}

/* Force Font Inheritance for Form Elements & Tables */
input, button, select, textarea, table, th, td {
  font-family: var(--font-family) !important;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- UTILITIES --- */
.hidden { display: none !important; }
.full-width { width: 100%; }
.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* --- HEADER --- */
header {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1rem 2rem;
  
  /* STRICT FIXED POSITIONING */
  position: relative; 
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000; /* High z-index to ensure it stays on top */
  
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.header-content {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.titles h1 {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #3730a3, #4f46e5, #06b6d4, #3730a3);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 5s linear infinite;
}

@keyframes shine {
  to { background-position: 300% center; }
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.1rem;
}

/* --- BUTTONS --- */
button {
  cursor: pointer;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

button:active { transform: scale(0.96); }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-main);
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: white;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-text { background: transparent; color: var(--text-muted); }
.btn-outline { border: 1px solid currentColor; background: transparent; }

/* AI Button */
.btn-ai {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    border: 1px solid rgba(255,255,255,0.2);
}
.btn-ai:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
    transform: translateY(-2px);
}
.btn-ai:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* --- MAIN LAYOUT --- */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
}

/* --- FILTERS --- */
#home-page .filters-section {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

#home-page .filters-container {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  border-radius: var(--radius-xl);
  display: flex;
  gap: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255,255,255,0.5);
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
}

#home-page .filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 150px;
}

#home-page .filter-group label {
  font-weight: 700;
  color: var(--secondary-dark);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#home-page .select-wrapper,
#home-page .input-wrapper {
  width: 100%;
}

#home-page select,
#home-page input[type="number"] {
  appearance: none;
  width: 100%;
  background-color: white;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  padding: 0.6rem 1.2rem;
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

#home-page select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.8rem center;
}

#home-page select:hover,
#home-page input:hover {
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

#home-page select:focus,
#home-page input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* --- INSTRUCTION BANNER --- */
.instruction-banner {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 0 1rem;
  animation: fadeIn 1s ease-out;
}

.instruction-text {
  display: inline-block;
  position: relative;
  font-weight: 800;
  color: var(--secondary-dark);
  font-size: 0.95rem;
  padding: 0.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid rgba(255,255,255,0.8);
}

.instruction-text::before,
.instruction-text::after {
  content: "";
  display: inline-block;
  width: 40px;
  height: 2px;
  background: linear-gradient(to left, var(--primary-light), var(--primary));
  vertical-align: middle;
  margin: 0 10px;
  opacity: 0.6;
}

.instruction-text::after {
  background: linear-gradient(to right, var(--primary-light), var(--primary));
}

/* --- PRODUCT GRID --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

#home-page .product-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  border: 1px solid rgba(255,255,255,0.8);
  display: flex;
  flex-direction: column;
}

#home-page .product-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}

#home-page .image-container {
  height: 280px;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
  cursor: zoom-in; /* Indicates modal open */
}

#home-page .product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

#home-page .product-card:hover .product-image {
  transform: scale(1.1);
}

#home-page .product-price-tag {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

#home-page .product-card:hover .product-price-tag {
  transform: translateY(0);
  opacity: 1;
}

#home-page .product-info {
  padding: 1.2rem;
  background: white;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#home-page .product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#home-page .badge {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
}

#home-page .size-badge { 
  background: #f1f5f9; 
  color: var(--secondary-dark); 
  font-size: 1.1rem; /* Larger Size Number */
}
#home-page .gender-badge { background: var(--primary-light); color: var(--primary-dark); font-size: 0.85rem; }

/* Copy ID Button */
.btn-copy-id {
    width: 100%;
    background: #f8fafc;
    color: var(--secondary-dark);
    border: 1px solid #e2e8f0;
    padding: 0.5rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.btn-copy-id:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* --- FULLSCREEN MODAL (FIXED) --- */
.modal {
    position: fixed;
    inset: 0; /* Covers entire viewport */
    z-index: 9999; /* Highest priority */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    background: rgba(0, 0, 0, 0.85); /* Darker dimmed background */
    backdrop-filter: blur(8px);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.modal-content {
    position: relative;
    z-index: 10000;
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh; /* Leave space for buttons */
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.modal-close-btn {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255,255,255,0.2);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: 2px solid rgba(255,255,255,0.3);
    cursor: pointer;
}
.modal-close-btn:hover {
    background: rgba(255,255,255,0.5);
    transform: rotate(90deg);
}

.modal-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.modal-actions .btn-primary {
    background: white;
    color: var(--primary-dark);
    font-weight: 800;
    padding: 0.8rem 2rem;
    border-radius: 99px;
}
.modal-actions .btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
}


/* --- ADMIN LOGIN (Redesigned) --- */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 450px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  padding: 3rem;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.5);
  text-align: center;
}

.login-header { margin-bottom: 2.5rem; }
.login-icon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--primary-light), #fff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: var(--primary);
  box-shadow: var(--shadow-md);
}

.login-header h2 { font-size: 1.8rem; margin-bottom: 0.5rem; color: var(--text-main); }
.login-header p { color: var(--text-muted); }

.form-group { margin-bottom: 1.5rem; text-align: right; }
.form-group label { display: block; margin-bottom: 0.8rem; font-weight: 700; color: var(--secondary-dark); }

.input-icon-wrapper { position: relative; }
.input-icon-wrapper i {
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: color 0.3s;
}

.login-card input {
  width: 100%;
  padding: 1rem 3rem 1rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  background: #f8fafc;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.login-card input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px var(--primary-light);
}
.login-card input:focus + i { color: var(--primary); }

.login-btn {
  padding: 1rem;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* --- ADMIN DASHBOARD UI --- */
#admin-dashboard .dashboard-header { margin-bottom: 2rem; }
#admin-dashboard .tracker-box { 
  background: white; 
  border: 1px solid #e2e8f0; 
  padding: 1rem; 
  border-radius: var(--radius-md); 
  display: flex; 
  align-items: center; 
  gap: 1rem; 
  flex-wrap: wrap;
}
#admin-dashboard .tracker-green { border-left: 5px solid var(--success); }
#admin-dashboard .tracker-orange { border-left: 5px solid #f59e0b; }
#admin-dashboard .tracker-red { border-left: 5px solid var(--danger); }

.tracker-date-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
  border-right: 1px solid #e2e8f0;
  padding-right: 0.8rem;
}

#admin-dashboard .admin-container { 
  background: white; 
  border-radius: var(--radius-lg); 
  box-shadow: var(--shadow-sm); 
  overflow: hidden; 
}

#admin-dashboard .admin-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 0.5rem 0.5rem 0;
  gap: 0.5rem;
  overflow-x: auto;
}

#admin-dashboard .tab-btn {
  background: transparent;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: var(--text-muted);
  font-weight: 600;
}
#admin-dashboard .tab-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

#admin-dashboard .tab-content { padding: 2rem; }
#admin-dashboard .tab-pane { display: none; }
#admin-dashboard .tab-pane.active { display: block; animation: fadeIn 0.3s ease; }

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

/* Admin Forms */
#admin-dashboard .form-card { max-width: 800px; margin: 0 auto; }
#admin-dashboard .form-row { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
#admin-dashboard .form-group { flex: 1; min-width: 200px; }
#admin-dashboard .form-group.full { width: 100%; }
#admin-dashboard label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--secondary-dark); }

#admin-dashboard input, #admin-dashboard select {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  transition: all 0.3s;
}
#admin-dashboard input:focus, #admin-dashboard select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: white;
}

/* API Config Box (Enhanced) */
.api-config-box {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px dashed #cbd5e1;
}
.api-config-box .text-small { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; display: block; }

.api-input-group {
    display: flex;
    gap: 0.5rem;
}
.api-input-group input {
    flex: 1;
    font-size: 0.9rem;
    padding: 0.6rem;
}
.api-input-group button {
    white-space: nowrap;
}

/* AI Stats */
.ai-stats-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    animation: fadeIn 0.3s ease;
}

.ai-total-credits {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: var(--secondary-dark);
    margin-bottom: 0.5rem;
}
.ai-total-credits strong {
    color: var(--primary);
    font-size: 1.2rem;
}

.credits-warning {
    background: #fef2f2;
    color: var(--danger);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-keys-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
}

.ai-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
}
.key-mask { font-family: monospace; color: var(--text-muted); }
.key-credits { font-weight: 700; color: var(--success); }
.key-credits.low { color: var(--danger); }

/* Image Preview */
#image-preview-container {
    margin-top: 1rem;
    text-align: center;
}
.preview-img {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 2px dashed #cbd5e1;
    padding: 0.5rem;
    background: #f8fafc;
}
.ai-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Admin Table (Redesigned) */
#admin-dashboard .table-card { overflow: hidden; }
#admin-dashboard .table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 1rem; }
#admin-dashboard .admin-search-box input { padding: 0.6rem 1rem; border-radius: 99px; width: 200px; }

#admin-dashboard .table-responsive { overflow-x: auto; }
#admin-dashboard table { 
  width: 100%; 
  border-collapse: separate; 
  border-spacing: 0 0.5rem; 
  margin-top: 0.5rem; 
}

#admin-dashboard th { 
  text-align: right; 
  padding: 1rem; 
  color: var(--text-muted); 
  font-size: 0.9rem;
  font-weight: 700;
}
#admin-dashboard th.col-price { min-width: 150px; }

#admin-dashboard td { 
  padding: 1rem; 
  background: white;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle; 
}

#admin-dashboard td:first-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; border-right: 1px solid #f1f5f9; }
#admin-dashboard td:last-child { border-radius: var(--radius-md) 0 0 var(--radius-md); border-left: 1px solid #f1f5f9; }

#admin-dashboard tr:hover td { background: #f8fafc; }

#admin-dashboard .thumbnail { 
  width: 60px; height: 60px; 
  object-fit: cover; 
  border-radius: var(--radius-md); 
  box-shadow: var(--shadow-sm);
}

.load-more-container { margin-top: 1.5rem; text-align: center; }

/* Admin Lists (Cards) */
.manage-card .inline-form {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.manage-card .inline-form input {
  flex: 1;
}
.manage-card .inline-form button {
  flex-shrink: 0;
}

.bulk-actions-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--primary-light);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  margin-top: 1rem;
  animation: slideDown 0.3s ease;
}

.bulk-info { display: flex; align-items: center; gap: 0.8rem; font-weight: 700; color: var(--primary-dark); }
.custom-checkbox { width: 1.2rem; height: 1.2rem; cursor: pointer; accent-color: var(--primary); }

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

.manage-item-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.manage-item-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.manage-item-card.selected {
  background: var(--primary-light);
  border-color: var(--primary);
}

.card-start { display: flex; align-items: center; gap: 1rem; }
.item-value { font-weight: 700; font-size: 1.1rem; }

/* --- FOOTER --- */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.65); /* Updated Dark Transparent */
  backdrop-filter: blur(10px);
  color: #cbd5e1;
  
  /* ADDED SIDE PADDING */
  padding: 1rem 24px; 

  
  z-index: 900;
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  margin-top: 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.footer-branches {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
}

.footer-branches p {
    margin: 0;
    color: #e2e8f0;
}

.footer-branches strong {
    color: white;
    margin-left: 0.3rem;
}

.footer-phone {
  font-size: 1rem;
  margin-top: 0.2rem;
  color: white;
}

.footer-phone strong {
    color: white;
    margin-left: 0.5rem;
}

/* Phone Link Style */
.phone-link {
  color: inherit;
  border-bottom: 1px dashed rgba(255,255,255,0.3);
  transition: all 0.3s ease;
}
.phone-link:hover {
  color: white;
  border-bottom-color: white;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 110px; /* Above the fixed footer */
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 1000; /* Above footer */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* Desktop layout optimization for Footer */
@media (min-width: 768px) {
    .footer-info {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .footer-branches {
        text-align: right;
        align-items: flex-start;
    }
    /* Body padding adjustment handled in global body rule */
}

/* --- NOTIFICATIONS --- */
#notification-area {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notification {
  padding: 1rem 2rem;
  border-radius: 50px;
  background: white;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  font-weight: 600;
  animation: slideDown 0.4s ease;
}
.notif-success { border-left: 5px solid var(--success); color: #064e3b; }
.notif-error { border-left: 5px solid var(--danger); color: #7f1d1d; }
@keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Spinner */
.loading-spinner {
  width: 40px; height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Infinite Scroll Loader */
.scroll-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 2rem 0;
  width: 100%;
  color: var(--text-muted);
  font-weight: 600;
}
.small-spinner {
  width: 24px;
  height: 24px;
  border-width: 3px;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  #home-page .image-container { height: 180px; }
  #home-page .product-price-tag { opacity: 1; transform: translateY(0); bottom: 0.5rem; right: 0.5rem; padding: 0.3rem 0.6rem; font-size: 0.9rem; }
  header { padding: 1rem; }
  .header-content { flex-direction: column; gap: 1rem; text-align: center; }
  #home-page .filters-container { flex-direction: column; width: 100%; gap: 1rem; align-items: stretch; }
  #home-page .filter-group { width: 100%; }
  .login-card { padding: 2rem; }
  
  .instruction-text {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
  .instruction-text::before, .instruction-text::after {
    width: 20px;
  }
  
  /* Mobile Modal Fixes */
  .modal-content {
    max-width: 95vw;
  }
  .modal-close-btn {
    top: 15px;
    right: 15px;
    position: fixed; /* Fixed on screen for mobile */
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
  }
  
  /* Footer Mobile Override */
  footer {
      padding: 0.8rem 24px; /* Updated padding for mobile */
  }
  .footer-branches {
      font-size: 0.75rem;
  }
  #back-to-top {
      bottom: 160px; /* Move up to avoid overlapping footer on mobile if needed */
  }
}
