/**
 * Webshop — retail SBI sites (AGENT-5)
 * --dim: #374151 (niet lichter)
 */
.shop-page {
  --dim: #374151;
}

.shop-page .btn-primary {
  color: #fff !important;
}

/* Toolbar */
.shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.shop-toolbar-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
}

.shop-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.shop-search-wrap i {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  font-size: 0.82rem;
}

.shop-search-wrap input {
  padding: 8px 12px 8px 34px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.84rem;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  width: 200px;
  transition: all 0.2s;
}

.shop-search-wrap input:focus {
  outline: none;
  border-color: var(--c);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
  width: 260px;
}

.shop-select {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--dim);
  background: #fff;
  max-width: 180px;
}

.shop-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.shop-cat {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.shop-cat:hover {
  border-color: var(--c);
  color: var(--c);
}

.shop-cat.active {
  background: var(--c);
  color: #fff;
  border-color: var(--c);
}

.shop-count {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 600;
}

.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  position: relative;
}

.cart-btn:hover {
  border-color: var(--c);
  color: var(--c);
}

.cart-btn span {
  background: var(--c);
  color: #fff;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 50px;
  min-width: 18px;
  text-align: center;
}

.shop-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.shop-pagination button {
  min-width: 40px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--dim);
  font-family: inherit;
}

.shop-pagination button:hover:not(:disabled) {
  border-color: var(--c);
  color: var(--c);
}

.shop-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.shop-pagination .shop-page-info {
  font-size: 0.82rem;
  color: #94a3b8;
}

/* Product grid */
.p-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.p-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.p-card:hover {
  border-color: var(--c);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.p-card-img {
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.p-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.p-card:hover .p-card-img img {
  transform: scale(1.06);
}

.p-card-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p-brand {
  font-size: 0.66rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px 0;
}

.p-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #0f172a;
  padding: 5px 14px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  min-height: 2.3em;
}

.p-stars {
  padding: 3px 14px 0;
  font-size: 0.7rem;
  color: #f59e0b;
}

.p-stars span {
  color: #94a3b8;
  font-weight: 600;
  margin-left: 2px;
}

.p-price {
  padding: 5px 14px 0;
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
}

.p-old {
  text-decoration: line-through;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 500;
}

.p-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 28px);
  margin: auto 14px 14px;
  padding: 9px;
  border: none;
  border-radius: 10px;
  background: var(--c);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}

.p-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.p-btn:active {
  transform: scale(0.97);
}

/* Cart drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -380px;
  width: 380px;
  height: 100vh;
  background: #fff;
  z-index: 501;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transition: right 0.3s var(--ease);
}

.cart-drawer.open {
  right: 0;
}

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

.cart-header h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  align-items: center;
}

.cart-item img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #f8fafc;
}

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

.cart-item-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--c);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.cart-item-qty button {
  width: 24px;
  height: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
}

.cart-item-qty span {
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
}

.cart-item-rm {
  color: #ef4444;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 4px;
}

.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.94rem;
}

.cart-total strong {
  font-size: 1.2rem;
  font-weight: 900;
  color: #0f172a;
}

.cart-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

.cart-empty i {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
  opacity: 0.3;
}

/* Toast */
.shop-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: #059669;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s var(--ease);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.shop-toast.shop-toast--warn {
  background: #d97706;
}

/* Quick view modal */
.shop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.shop-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.shop-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.shop-modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shop-modal-head h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.shop-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .shop-modal-body {
    grid-template-columns: 1fr;
  }
}

.shop-modal-img {
  aspect-ratio: 1;
  background: #f8fafc;
}

.shop-modal-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-modal-info {
  padding: 20px;
  font-size: 0.9rem;
  color: var(--dim);
  line-height: 1.55;
}

.shop-modal-price {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
  margin: 10px 0;
}

/* Checkout */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }
}

.checkout-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
}

.checkout-summary h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 14px;
}

.checkout-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  color: var(--dim);
}

.checkout-line strong {
  color: #0f172a;
}

.checkout-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dim);
  margin-bottom: 4px;
}

.checkout-form input,
.checkout-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.checkout-form textarea {
  min-height: 72px;
  resize: vertical;
}

@media (max-width: 640px) {
  .p-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .p-title {
    font-size: 0.78rem;
    padding: 4px 10px 0;
  }

  .p-price {
    padding: 4px 10px 0;
    font-size: 0.92rem;
  }

  .p-btn {
    margin: 6px 10px 10px;
    padding: 7px;
    font-size: 0.76rem;
  }

  .p-brand {
    padding: 8px 10px 0;
  }

  .p-stars {
    padding: 2px 10px 0;
  }

  .cart-drawer {
    width: 100%;
    right: -100%;
  }

  .shop-search-wrap input {
    width: 140px;
  }

  .shop-search-wrap input:focus {
    width: 180px;
  }

  .shop-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .shop-cats {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .shop-cat {
    flex-shrink: 0;
  }
}

@media (max-width: 380px) {
  .p-grid {
    grid-template-columns: 1fr;
  }
}
