/* ============================================================
   E-SHOP STYLES
   ============================================================ */

/* ---- SHOP HERO ---- */
.shop-hero {
  background: var(--color-dark-bg);
  padding: 140px 20px 60px;
  text-align: center;
}
.shop-hero__title {
  font-family: var(--font-heading-bold);
  font-size: 3rem;
  color: var(--color-primary);
  letter-spacing: 4px;
  margin: 0 0 10px;
}
.shop-hero__subtitle {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
  margin: 0;
}

/* ---- CART TOGGLE (header) ---- */
.cart-toggle {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-primary-dark);
  padding: 8px;
  margin-left: 10px;
}
.cart-count {
  position: absolute;
  top: 0;
  right: -2px;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---- SHOP LAYOUT ---- */
.shop-main {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 20px 60px;
  gap: 30px;
  min-height: 60vh;
}

/* ---- SIDEBAR ---- */
.shop-sidebar {
  width: 280px;
  flex-shrink: 0;
}
.sidebar-close {
  display: none;
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--color-text);
}
.sidebar-section {
  margin-bottom: 28px;
}
.sidebar-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--color-primary-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary);
}

/* Search */
.search-box {
  position: relative;
}
.search-input {
  width: 100%;
  padding: 10px 38px 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: #fff;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
}

/* Category list */
.category-list, .subcategory-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.category-list li, .subcategory-list li {
  margin-bottom: 2px;
}
.category-list button, .subcategory-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--color-text);
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  text-align: left;
}
.category-list button:hover, .subcategory-list button:hover {
  background: var(--color-cream);
}
.category-list button.active {
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-heading);
}
.subcategory-list button.active {
  background: rgba(189, 128, 87, 0.15);
  color: var(--color-primary-dark);
  font-family: var(--font-heading);
}
.cat-count {
  font-size: 0.78rem;
  opacity: 0.6;
  margin-left: 6px;
}

/* Price filter */
.price-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.price-input {
  width: 70px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-align: center;
}
.price-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.price-sep {
  color: #999;
}
.btn-filter-price {
  padding: 8px 14px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.8rem;
}

/* Sort */
.sort-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  background: #fff;
  cursor: pointer;
}
.sort-select:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ---- SHOP CONTENT ---- */
.shop-content {
  flex: 1;
  min-width: 0;
}

/* Toolbar */
.shop-toolbar {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}
.filter-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--color-text);
}
.shop-breadcrumb {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text-light);
}
.shop-breadcrumb span {
  cursor: pointer;
}
.shop-breadcrumb span:hover {
  color: var(--color-primary);
}
.shop-breadcrumb .sep {
  margin: 0 6px;
  color: #ccc;
}
.results-count {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* ---- PRODUCT GRID (shop) ---- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}
.shop-grid .product-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.25s, box-shadow 0.25s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.shop-grid .product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.shop-card__image {
  width: 100%;
  aspect-ratio: 1;
  background: var(--color-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.shop-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shop-card__placeholder {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--color-primary);
  opacity: 0.3;
}
.shop-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--color-primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}
.shop-card__body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.shop-card__category {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.shop-card__name {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  color: var(--color-text);
  margin: 0 0 8px;
  line-height: 1.3;
  flex: 1;
}
.shop-card__sku {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: #999;
  margin-bottom: 8px;
}
.shop-card__price {
  font-family: var(--font-heading-bold);
  font-size: 1.1rem;
  color: var(--color-primary-dark);
}
.shop-card__price.no-price {
  font-size: 0.85rem;
  color: #999;
  font-family: var(--font-body);
}
.shop-card__add {
  margin-top: 10px;
  padding: 8px 0;
  border: 1px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary);
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.5px;
}
.shop-card__add:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
}
.page-btn {
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--color-text);
  transition: background 0.2s, border-color 0.2s;
}
.page-btn:hover {
  border-color: var(--color-primary);
}
.page-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* No results */
.no-results {
  text-align: center;
  padding: 80px 20px;
}
.no-results svg {
  opacity: 0.4;
  margin-bottom: 20px;
}
.no-results p {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--color-text-light);
  margin-bottom: 20px;
}

/* ---- PRODUCT MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: #666;
  z-index: 10;
  line-height: 1;
}
.modal-close:hover {
  color: var(--color-primary);
}

.product-modal__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.product-modal__image {
  background: var(--color-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 350px;
  border-radius: 12px 0 0 12px;
  overflow: hidden;
}
.product-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-modal__info {
  padding: 40px 30px;
}
.product-modal__category {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.product-modal__name {
  font-family: var(--font-heading-bold);
  font-size: 1.5rem;
  color: var(--color-primary-dark);
  margin: 10px 0 8px;
  line-height: 1.3;
}
.product-modal__sku {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: #999;
  margin: 0 0 16px;
}
.product-modal__description {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--color-text);
  line-height: 1.6;
  margin: 0 0 20px;
}
.product-modal__price {
  font-family: var(--font-heading-bold);
  font-size: 1.8rem;
  color: var(--color-primary-dark);
  margin-bottom: 24px;
}
.product-modal__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Quantity */
.quantity-control {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}
.qty-btn {
  padding: 10px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--color-text);
  transition: background 0.2s;
}
.qty-btn:hover {
  background: var(--color-cream);
}
.qty-input {
  width: 44px;
  text-align: center;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 8px 0;
  -moz-appearance: textfield;
}
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.btn--add-cart {
  flex: 1;
  padding: 12px 20px;
}

/* ---- CART SIDEBAR ---- */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2500;
}
.cart-overlay.open {
  display: block;
}
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: #fff;
  z-index: 2600;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  transition: right 0.3s ease;
}
.cart-sidebar.open {
  right: 0;
}
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}
.cart-header h3 {
  font-family: var(--font-heading-bold);
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  margin: 0;
}
.cart-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
}
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}
.cart-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}
.cart-item__image {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  background: var(--color-cream);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cart-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cart-item__details {
  flex: 1;
  min-width: 0;
}
.cart-item__name {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item__price {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--color-primary);
}
.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.cart-item__qty button {
  width: 24px;
  height: 24px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--color-text);
}
.cart-item__qty span {
  font-family: var(--font-body);
  font-size: 0.85rem;
  min-width: 20px;
  text-align: center;
}
.cart-item__remove {
  align-self: flex-start;
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  font-size: 18px;
  padding: 4px;
}
.cart-item__remove:hover {
  color: #e74c3c;
}
.cart-empty {
  display: none;
  text-align: center;
  padding: 60px 20px;
  flex: 1;
}
.cart-empty p {
  font-family: var(--font-body);
  color: #999;
  font-size: 0.95rem;
}
.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid #eee;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-heading-bold);
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  margin-bottom: 16px;
}
.cart-checkout {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
}

/* ---- CHECKOUT MODAL ---- */
.checkout-modal {
  max-width: 700px;
  padding: 40px;
}
.checkout-title {
  font-family: var(--font-heading-bold);
  font-size: 1.5rem;
  color: var(--color-primary-dark);
  margin: 0 0 30px;
}
.checkout-section {
  margin-bottom: 30px;
}
.checkout-section h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-primary-dark);
  margin: 0 0 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}
.form-row {
  margin-bottom: 14px;
}
.form-row--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-row--3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
.form-group label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-bottom: 5px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  box-sizing: border-box;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}
.form-group textarea {
  resize: vertical;
}

/* Payment methods */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.payment-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.payment-method:hover {
  border-color: var(--color-primary);
}
.payment-method.selected {
  border-color: var(--color-primary);
  background: rgba(189,128,87,0.05);
}
.payment-method input[type="radio"] {
  accent-color: var(--color-primary);
}
.payment-method__info {
  flex: 1;
}
.payment-method__name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--color-text);
}
.payment-method__desc {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: #999;
  margin-top: 2px;
}

/* Checkout summary */
.checkout-summary {
  margin-bottom: 14px;
}
.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--color-text);
}
.checkout-item span:last-child {
  font-family: var(--font-heading);
}
.checkout-total {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 2px solid var(--color-primary);
  font-family: var(--font-heading-bold);
  font-size: 1.15rem;
  color: var(--color-primary-dark);
}
.btn--checkout-submit {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-top: 20px;
}

/* Invoice toggle */
.invoice-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: var(--font-heading);
}
.invoice-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}
.invoice-fields {
  margin-top: 14px;
}

/* ---- TOAST NOTIFICATION ---- */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--color-dark-bg);
  color: #fff;
  padding: 14px 24px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  z-index: 5000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
  }
}

@media (max-width: 768px) {
  .shop-hero {
    padding: 120px 20px 40px;
  }
  .shop-hero__title {
    font-size: 2rem;
  }
  .shop-main {
    flex-direction: column;
    padding: 20px 15px 40px;
  }

  .shop-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: #fff;
    z-index: 2000;
    padding: 60px 24px 30px;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
  .shop-sidebar.open {
    left: 0;
  }
  .sidebar-close {
    display: block;
  }
  .filter-toggle {
    display: flex;
  }

  .product-modal__body {
    grid-template-columns: 1fr;
  }
  .product-modal__image {
    border-radius: 12px 12px 0 0;
    min-height: 250px;
  }
  .product-modal__info {
    padding: 24px 20px;
  }
  .product-modal__actions {
    flex-direction: column;
  }
  .btn--add-cart {
    width: 100%;
  }

  .checkout-modal {
    padding: 24px;
  }
  .form-row--2, .form-row--3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .shop-card__body {
    padding: 12px;
  }
  .shop-card__name {
    font-size: 0.82rem;
  }
  .shop-card__price {
    font-size: 0.95rem;
  }
}
