/* CSS Variables */
:root {
  --primary-grad: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  --secondary-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-gold: #ffd700;
  --bg-light: #f7f8fc;
  --text-main: #222;
  --success: #28a745;
  --danger: #dc3545;
  --muted: #6c757d;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-light);
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* Header */
.header {
  background: var(--primary-grad);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo h1 {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent-gold);
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav a:hover {
  color: var(--accent-gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* UPDATED: World Country Selector - REPLACES .currency-selector */
.country-selector-wrapper {
  position: relative;
  min-width: 240px;
}

.country-selector {
  width: 100%;
  padding: 0.65rem 2.8rem 0.65rem 1.2rem;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  height: 46px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.country-selector:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255,215,0,0.3);
}

.country-selector:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 4px rgba(255,215,0,0.2), 0 8px 25px rgba(255,215,0,0.3);
  transform: translateY(-2px);
}

.country-selector option {
  padding: 1rem;
  background: white;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
}

.country-selector optgroup {
  font-weight: 700;
  color: var(--text-main);
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  font-size: 0.85rem;
}

.country-selector::-webkit-scrollbar {
  width: 8px;
}

.country-selector::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.country-selector::-webkit-scrollbar-thumb {
  background: var(--secondary-grad);
  border-radius: 4px;
}

.cart-btn {
  position: relative;
  background: var(--accent-gold);
  color: var(--text-main);
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.cart-btn:hover {
  transform: scale(1.05);
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: white;
  transition: 0.3s;
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Hero Section */
.hero {
  background: var(--secondary-grad);
  color: white;
  padding: 8rem 2rem;
  text-align: center;
}

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

.hero-content p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.btn-primary {
  display: inline-block;
  background: var(--accent-gold);
  color: var(--text-main);
  padding: 1rem 2.5rem;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: transform 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
}

/* Filter Section */
.filter-section {
  padding: 3rem 0 1rem;
}

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

.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.7rem 1.5rem;
  background: white;
  border: 2px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--secondary-grad);
  color: white;
  border-color: transparent;
}

/* Products Section */
.products-section {
  padding: 2rem 0 4rem;
}

.category-section {
  margin-bottom: 4rem;
}

.category-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text-main);
  padding-left: 1rem;
  border-left: 4px solid var(--accent-gold);
}

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

.product-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.product-image {
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #b7c7d0;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-info {
  padding: 1.5rem;
}

/* Product Selection Styles */
.size-selector,
.quantity-selector {
  margin: 1rem 0 0.8rem 0;
}

.size-selector label,
.quantity-selector label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.size-options {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.size-btn {
  padding: 0.4rem 0.8rem;
  border: 2px solid #ddd;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  min-width: 35px;
  text-align: center;
}

.size-btn:hover,
.size-btn.active {
  background: var(--secondary-grad);
  color: white;
  border-color: var(--secondary-grad);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8f9fa;
  padding: 0.5rem;
  border-radius: 8px;
  width: fit-content;
  border: 1px solid #e9ecef;
}

.qty-minus,
.qty-plus {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--secondary-grad);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.qty-minus:hover,
.qty-plus:hover {
  transform: scale(1.1);
  background: var(--primary-grad);
  box-shadow: 0 2px 8px rgba(15, 32, 39, 0.3);
}

.qty-display {
  font-weight: 600;
  min-width: 30px;
  text-align: center;
  font-size: 1rem;
  color: var(--text-main);
  padding: 0.2rem 0.5rem;
}

.product-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.product-category {
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: capitalize;
  margin-bottom: 0.5rem;
}

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

.add-to-cart-btn {
  width: 100%;
  padding: 0.8rem;
  background: var(--primary-grad);
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 0.5rem;
}

.add-to-cart-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 10px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 2px solid #eee;
}

.modal-header h2 {
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

.close-btn:hover {
  color: var(--danger);
}

.modal-body {
  padding: 1.5rem;
}

/* Cart Items */
.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  align-items: center;
  flex-wrap: wrap;
}

.cart-item-info {
  flex: 1;
  min-width: 150px;
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
  line-height: 1.3;
}

.cart-item-size {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 0.3rem;
}

.cart-item-price {
  color: var(--success);
  font-weight: bold;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--secondary-grad);
  color: white;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.qty-btn:hover {
  background: var(--primary-grad);
  transform: scale(1.05);
}

.qty-value {
  width: 40px;
  text-align: center;
  font-weight: bold;
}

.remove-btn {
  background: var(--danger);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.remove-btn:hover {
  background: #c82333;
  transform: translateX(-2px);
}

.cart-summary {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid #eee;
}

.cart-total {
  font-size: 1.5rem;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-weight: bold;
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  margin-right: 1rem;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.btn-full {
  width: 100%;
}

.empty-cart {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

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

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

.checkout-summary {
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: 5px;
  margin-bottom: 1.5rem;
}

.checkout-summary h3 {
  margin-bottom: 1rem;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #ddd;
  font-size: 0.95rem;
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.3rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--text-main);
  font-weight: bold;
}

/* Success Modal */
.success-content {
  text-align: center;
  padding: 3rem 2rem;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin: 0 auto 1.5rem;
}

/* About Section */
.about-section {
  padding: 4rem 0;
  background: white;
  text-align: center;
}

.about-section p {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Footer */
.footer {
  background: var(--primary-grad);
  color: white;
  padding: 3rem 0 1rem;
}

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

.footer-section h3,
.footer-section h4 {
  margin-bottom: 1rem;
  color: var(--accent-gold);
}

.footer-section a {
  display: block;
  color: white;
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

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

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


/* Responsive Design */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
    z-index: 1001;
  }

  .nav {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    flex-direction: column;
    background: var(--primary-grad);
    padding: 2rem;
    transition: left 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 999;
  }

  .nav.active {
    left: 0;
  }

  .logo {
    flex: 1;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .country-selector-wrapper {
    min-width: 200px;
  }

  .country-selector {
    font-size: 0.9rem;
    padding: 0.55rem 2.5rem 0.55rem 1rem;
    height: 42px;
  }

  .hero {
    padding: 4rem 2rem;
  }

  .hero-content h2 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

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

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

  .filter-buttons {
    gap: 0.5rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .cart-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-danger {
    margin-bottom: 0.5rem;
    margin-right: 0;
  }

  /* Mobile size/quantity adjustments */
  .size-options {
    gap: 0.3rem;
  }
  
  .size-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    min-width: 32px;
  }
  
  .quantity-controls {
    padding: 0.4rem;
  }
  
  .product-info {
    padding: 1.2rem;
  }
}



/* ===== Login page ===== */
body.admin-login-page {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #1d4ed8, #020617 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: #020617;
  color: #e5e7eb;
  padding: 2rem 2.2rem;
  border-radius: 1.2rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

.login-card h1 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
}

.login-card p {
  margin: 0 0 1.4rem;
  font-size: 0.9rem;
  color: #9ca3af;
}

.login-card input {
  width: 100%;
  margin-bottom: 0.9rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.7rem;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.login-card button {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.7rem;
  border: none;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.2rem;
}

#loginMessage {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #f97316;
}

/* ===== Admin dashboard layout ===== */
body.admin-page {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f172a;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  background: #020617;
  color: #e5e7eb;
  padding: 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-logo {
  font-size: 1.4rem;
  font-weight: 700;
}

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

.admin-nav-item {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-radius: 0.6rem;
  border: none;
  cursor: pointer;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.admin-nav-item.active,
.admin-nav-item:hover {
  background: #1d4ed8;
}

.admin-logout {
  margin-top: auto;
  padding: 0.5rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid #374151;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Main */
.admin-main {
  background: #f3f4f6;
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.admin-main-header h1 {
  margin: 0 0 1.2rem;
  font-size: 1.6rem;
  color: #111827;
}

.admin-section {
  width: 100%;
  max-width: 820px;
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.6rem 1.9rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.admin-section h2,
.admin-section h3 {
  margin-top: 0.6rem;
  margin-bottom: 0.4rem;
  color: #111827;
}

/* Inputs & textareas */
.admin-section input,
.admin-section textarea {
  width: 100%;
  margin-bottom: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid #e5e7eb;
  font-size: 0.9rem;
  box-sizing: border-box;
  font-family: inherit;
  background: #f9fafb;
}

.admin-section textarea {
  min-height: 100px;
  resize: vertical;
}

/* Buttons */
#saveSettingsBtn,
#productForm button[type="submit"] {
  background: #1d4ed8;
  color: #ffffff;
  border-radius: 0.6rem;
  border: none;
  padding: 0.7rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.2rem;
}

#productForm button[type="button"] {
  background: #dc2626;
  color: #ffffff;
  border-radius: 0.6rem;
  border: none;
  padding: 0.7rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  margin-left: 0.4rem;
}

#saveStatus {
  font-size: 0.86rem;
  color: #6b7280;
  margin-top: 0.3rem;
}

/* Products card + table */
.admin-products-card {
  margin-top: 1rem;
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.admin-table-wrapper {
  margin-bottom: 1.2rem;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.admin-table thead {
  background: #eff6ff;
}

.admin-table th,
.admin-table td {
  padding: 0.6rem 0.7rem;
  font-size: 0.88rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.admin-table th {
  font-weight: 600;
  color: #4b5563;
}

.admin-table tbody tr:hover {
  background: #f9fafb;
}

/* Thumbnail */
.admin-product-thumb {
  width: 44px;
  height: 44px;
  border-radius: 0.6rem;
  object-fit: cover;
  background: #e5e7eb;
}

/* Action buttons */
.admin-action-btn {
  padding: 0.25rem 0.6rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
}

.admin-action-btn.edit {
  background: #dbeafe;
  color: #1d4ed8;
}

.admin-action-btn.delete {
  background: #fee2e2;
  color: #b91c1c;
}

/* Responsive */
@media (max-width: 800px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .admin-nav {
    flex-direction: row;
  }
  .admin-main {
    padding: 1.2rem;
  }
  .admin-section {
    padding: 1.1rem 1.3rem;
  }
  .admin-table {
    min-width: 100%;
  }
}

