/* ========================================
   SmartShop — Fully Responsive Styles
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=DM+Sans:wght@300;400;500&display=swap');

/* ============================================================
   TOKENS
============================================================ */
:root {
  --ss-primary:    #1a1a2e;
  --ss-accent:     #e94560;
  --ss-accent-lt:  #ff6b80;
  --ss-bg:         #f8f7f4;
  --ss-card:       #ffffff;
  --ss-border:     #e8e6e1;
  --ss-text:       #1a1a2e;
  --ss-muted:      #6b6878;
  --ss-radius:     12px;
  --ss-radius-sm:  8px;
  --ss-shadow:     0 2px 16px rgba(26,26,46,.08);
  --ss-shadow-lg:  0 8px 32px rgba(26,26,46,.16);
  --ss-font:       'Sora', sans-serif;
  --ss-body:       'DM Sans', sans-serif;
  --ss-ease:       0.22s cubic-bezier(.4,0,.2,1);
  --ss-pad:        28px;
}

.ss-shop-wrapper *,
.ss-shop-wrapper *::before,
.ss-shop-wrapper *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ============================================================
   WRAPPER — full-width breakout
============================================================ */
.ss-shop-wrapper {
  font-family: var(--ss-body);
  color: var(--ss-text);
  background: #e4e4e2;
  min-height: 80vh;
  padding-bottom: 64px;
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  max-width: 100vw !important;
  overflow-x: hidden;
}

.ss-inner-box {
  margin: 28px 10%;
  background: var(--ss-bg);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 40px rgba(26,26,46,.12);
}

/* ============================================================
   TOP BAR
============================================================ */
.ss-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--ss-pad);
  background: var(--ss-primary);
  border-radius: 18px 18px 0 0;
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 12px;
}
.ss-shop-title {
  font-family: var(--ss-font);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}
.ss-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ss-cart-btn {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  border-radius: 50px;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--ss-font);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--ss-ease);
  white-space: nowrap;
}
.ss-cart-btn:hover { background: rgba(255,255,255,.22); }
.ss-cart-count {
  background: var(--ss-accent);
  color: #fff;
  border-radius: 50px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
}
.ss-cart-count.ss-bounce { animation: ss-bounce .3s ease; }
@keyframes ss-bounce { 0%,100%{transform:scale(1)} 50%{transform:scale(1.4)} }

.ss-auth-btn, .ss-user-btn {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  border-radius: 50px;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--ss-font);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--ss-ease);
  white-space: nowrap;
}
.ss-auth-btn:hover, .ss-user-btn:hover { background: rgba(255,255,255,.22); }

.ss-user-menu { position: relative; }
.ss-user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--ss-card);
  border: 1px solid var(--ss-border);
  border-radius: var(--ss-radius-sm);
  box-shadow: var(--ss-shadow-lg);
  min-width: 140px;
  overflow: hidden;
  display: none;
  z-index: 300;
}
.ss-user-dropdown.ss-open { display: block; }
.ss-logout-btn {
  background: none;
  border: none;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  font-family: var(--ss-font);
  font-size: 14px;
  color: var(--ss-accent);
  transition: background var(--ss-ease);
}
.ss-logout-btn:hover { background: #fff5f5; }

/* ============================================================
   CONTENT
============================================================ */
.ss-content { padding: var(--ss-pad); }

.ss-alert {
  padding: 13px 16px;
  border-radius: var(--ss-radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}
.ss-alert-success { background:#d1fae5; color:#065f46; border:1px solid #6ee7b7; }
.ss-alert-warning { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; }

/* ============================================================
   PRODUCT GRID
============================================================ */
.ss-product-grid { display: grid; gap: 16px; }
.ss-cols-5 { grid-template-columns: repeat(5, 1fr); }
.ss-cols-4 { grid-template-columns: repeat(4, 1fr); }
.ss-cols-3 { grid-template-columns: repeat(3, 1fr); }

.ss-no-products {
  grid-column: 1/-1;
  text-align: center;
  padding: 64px 24px;
  color: var(--ss-muted);
  font-size: 17px;
}

/* ============================================================
   PRODUCT CARD
============================================================ */
.ss-product-card {
  background: var(--ss-card);
  border-radius: var(--ss-radius);
  border: 1px solid var(--ss-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--ss-ease), transform var(--ss-ease);
}
.ss-product-card:hover {
  box-shadow: var(--ss-shadow-lg);
  transform: translateY(-3px);
}
.ss-product-img {
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: #f3f2ef;
  position: relative;
}
.ss-product-img img { width:100%; height:100%; object-fit:cover; transition:transform .4s ease; }
.ss-product-card:hover .ss-product-img img { transform: scale(1.06); }
.ss-no-img { width:100%; height:100%; display:flex; align-items:center; justify-content:center; color:#ccc; }

.ss-badge {
  position: absolute; top:8px; left:8px;
  border-radius: 50px; padding: 3px 9px;
  font-size: 10px; font-weight: 700;
  font-family: var(--ss-font);
}
.ss-badge-out { background:#fee2e2; color:#dc2626; }
.ss-badge-low { background:#fef3c7; color:#d97706; }

.ss-product-info {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.ss-product-name {
  font-family: var(--ss-font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  color: var(--ss-text);
  transition: color var(--ss-ease);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ss-product-name:hover { color: var(--ss-accent); }
.ss-product-short-desc {
  font-size: 11px;
  color: var(--ss-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.ss-product-footer { margin-top: 8px; }
.ss-price {
  font-family: var(--ss-font);
  font-size: 15px;
  font-weight: 700;
  color: var(--ss-text);
}

/* ---- Two action buttons — always stacked ---- */
.ss-product-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}
.ss-view-btn {
  width: 100%;
  background: transparent;
  color: var(--ss-text);
  border: 1.5px solid var(--ss-border);
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
  font-family: var(--ss-font);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background var(--ss-ease), border-color var(--ss-ease), color var(--ss-ease);
}
.ss-view-btn:hover {
  background: var(--ss-primary);
  border-color: var(--ss-primary);
  color: #fff;
}
.ss-add-btn {
  width: 100%;
  background: var(--ss-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
  font-family: var(--ss-font);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background var(--ss-ease), transform .1s;
}
.ss-add-btn:hover { background: var(--ss-accent-lt); }
.ss-add-btn:active { transform: scale(.97); }
.ss-add-btn-disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  border: none;
  border-radius: 8px;
  padding: 9px 10px;
  width: 100%;
  font-family: var(--ss-font);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.ss-add-btn-disabled:hover { background: #e5e7eb; transform: none; }

/* ============================================================
   PAGINATION
============================================================ */
.ss-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 32px;
  flex-wrap: wrap;
}
.ss-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 1px solid var(--ss-border);
  background: var(--ss-card);
  color: var(--ss-text);
  text-decoration: none;
  font-family: var(--ss-font);
  font-size: 14px;
  font-weight: 500;
  transition: var(--ss-ease);
}
.ss-page-btn:hover { border-color: var(--ss-accent); color: var(--ss-accent); }
.ss-page-active { background: var(--ss-accent); color:#fff !important; border-color: var(--ss-accent); }

/* ============================================================
   OVERLAY
============================================================ */
.ss-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,46,.55);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ss-ease);
  backdrop-filter: blur(3px);
}
.ss-overlay.ss-active { opacity:1; pointer-events:all; }

/* ============================================================
   CART SIDEBAR
============================================================ */
.ss-cart-sidebar {
  position: fixed;
  top: 0; right: -100%;
  width: min(400px, 100vw);
  height: 100vh;
  background: var(--ss-card);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 32px rgba(26,26,46,.18);
  transition: right .3s cubic-bezier(.4,0,.2,1);
}
.ss-cart-sidebar.ss-open { right: 0; }

.ss-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--ss-primary);
  flex-shrink: 0;
}
.ss-sidebar-header h2 {
  font-family: var(--ss-font);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}
.ss-close-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--ss-ease);
  line-height: 1;
}
.ss-close-btn:hover { background: rgba(255,255,255,.28); }

.ss-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ss-cart-empty { text-align:center; color:var(--ss-muted); margin-top:48px; font-size:14px; }
.ss-cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--ss-border);
  border-radius: var(--ss-radius-sm);
}
.ss-cart-item-img { width:52px; height:52px; object-fit:cover; border-radius:6px; flex-shrink:0; }
.ss-cart-no-img { width:52px; height:52px; background:#f3f2ef; border-radius:6px; flex-shrink:0; }
.ss-cart-item-details { flex:1; display:flex; flex-direction:column; gap:2px; min-width:0; }
.ss-cart-item-name { font-size:12px; font-weight:600; font-family:var(--ss-font); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ss-cart-item-price { font-size:11px; color:var(--ss-accent); font-weight:600; }
.ss-cart-item-qty { display:flex; align-items:center; gap:4px; flex-shrink:0; }
.ss-cart-item-qty button {
  width:26px; height:26px;
  border:1px solid var(--ss-border);
  background:#f8f7f4;
  border-radius:6px;
  cursor:pointer;
  font-size:14px;
  display:flex; align-items:center; justify-content:center;
  transition: var(--ss-ease);
}
.ss-cart-item-qty button:hover { background:var(--ss-primary); color:#fff; border-color:var(--ss-primary); }
.ss-cart-item-qty span { font-size:13px; font-weight:600; min-width:20px; text-align:center; }
.ss-remove-btn { background:none; border:none; color:#ccc; font-size:18px; cursor:pointer; padding:2px 5px; border-radius:5px; transition:color var(--ss-ease); }
.ss-remove-btn:hover { color:var(--ss-accent); }

.ss-cart-footer { padding:16px 20px; border-top:1px solid var(--ss-border); background:var(--ss-bg); flex-shrink:0; }
.ss-cart-total { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; font-family:var(--ss-font); font-weight:700; font-size:16px; }
.ss-checkout-btn {
  width:100%; padding:12px;
  background:#0070ba; color:#fff;
  border:none; border-radius:var(--ss-radius-sm);
  font-family:var(--ss-font); font-size:14px; font-weight:600;
  cursor:pointer;
  transition: background var(--ss-ease);
  display:flex; align-items:center; justify-content:center; gap:7px;
}
.ss-checkout-btn:hover:not(:disabled) { background:#003087; }
.ss-checkout-btn:disabled { background:#e5e7eb; color:#9ca3af; cursor:not-allowed; }
.ss-checkout-note { text-align:center; font-size:11px; color:var(--ss-muted); margin-top:7px; }

/* ============================================================
   AUTH / CHECKOUT MODALS
============================================================ */
.ss-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(26,26,46,.6);
  backdrop-filter: blur(4px);
}
.ss-modal.ss-open { display: flex; }

.ss-modal-content {
  background: var(--ss-card);
  border-radius: var(--ss-radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 460px;
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(26,26,46,.25);
  animation: ss-modal-in .2s ease;
}
@keyframes ss-modal-in { from{opacity:0;transform:scale(.96)} to{opacity:1;transform:scale(1)} }

.ss-modal-close {
  position: absolute; top:14px; right:14px;
  background:var(--ss-bg); border:1px solid var(--ss-border);
  color:var(--ss-muted); font-size:20px;
  width:34px; height:34px; border-radius:8px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition: var(--ss-ease);
}
.ss-modal-close:hover { background:var(--ss-accent); color:#fff; border-color:var(--ss-accent); }

.ss-auth-tabs { display:flex; gap:2px; margin-bottom:20px; background:var(--ss-bg); border-radius:var(--ss-radius-sm); padding:4px; }
.ss-tab { flex:1; padding:9px; background:none; border:none; border-radius:6px; cursor:pointer; font-family:var(--ss-font); font-size:13px; font-weight:500; color:var(--ss-muted); transition:var(--ss-ease); }
.ss-tab-active { background:var(--ss-card); color:var(--ss-text); box-shadow:var(--ss-shadow); }

.ss-auth-form h3 { font-family:var(--ss-font); font-size:18px; font-weight:700; margin-bottom:16px; }
.ss-form-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.ss-form-group { display:flex; flex-direction:column; gap:5px; margin-bottom:12px; }
.ss-form-group label { font-family:var(--ss-font); font-size:12px; font-weight:600; color:var(--ss-text); }
.ss-form-group input,
.ss-form-group textarea,
.ss-form-group select {
  border:1.5px solid var(--ss-border);
  border-radius:var(--ss-radius-sm);
  padding:9px 12px;
  font-family:var(--ss-body);
  font-size:14px;
  color:var(--ss-text);
  background:#fff;
  width:100%;
  transition:border-color var(--ss-ease);
}
.ss-form-group input:focus,
.ss-form-group textarea:focus { outline:none; border-color:var(--ss-accent); }
.ss-form-error { color:var(--ss-accent); font-size:12px; margin-bottom:8px; font-weight:500; min-height:16px; }
.ss-btn-primary {
  width:100%; padding:12px;
  background:var(--ss-primary); color:#fff;
  border:none; border-radius:var(--ss-radius-sm);
  font-family:var(--ss-font); font-size:14px; font-weight:600;
  cursor:pointer; transition:background var(--ss-ease);
}
.ss-btn-primary:hover { background:var(--ss-accent); }
.ss-hidden { display:none !important; }

/* ============================================================
   PRODUCT DETAIL MODAL — Amazon style
   KEY FIX: fixed height columns, inner scroll on right panel
============================================================ */
.ss-product-modal-content {
  max-width: 860px !important;
  width: 94vw !important;
  padding: 24px !important;
  border-radius: 16px !important;
  max-height: 85vh !important;
  overflow-y: auto !important;
}
.ss-product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 600px) {
  .ss-product-detail { grid-template-columns: 1fr; }
}
.ss-product-detail-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--ss-radius-sm);
}
.ss-product-detail-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.ss-product-detail-thumb {
  width: 60px; height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--ss-ease);
}
.ss-product-detail-thumb.ss-thumb-active { border-color: var(--ss-accent); }
.ss-product-detail-info { display: flex; flex-direction: column; gap: 12px; }
.ss-product-detail-name { font-family: var(--ss-font); font-size: 22px; font-weight: 700; line-height: 1.3; }
.ss-product-detail-price { font-family: var(--ss-font); font-size: 26px; font-weight: 800; color: var(--ss-accent); }
.ss-product-detail-stock { font-size: 13px; color: var(--ss-muted); }
.ss-product-detail-desc { font-size: 14px; line-height: 1.7; color: var(--ss-muted); }
.ss-product-detail-full-desc { font-size: 14px; line-height: 1.7; }
.ss-qty-row { display: flex; align-items: center; gap: 12px; }
.ss-qty-control {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--ss-border);
  border-radius: var(--ss-radius-sm);
  overflow: hidden;
}
.ss-qty-control button {
  background: var(--ss-bg);
  border: none;
  width: 36px; height: 36px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--ss-ease);
}
.ss-qty-control button:hover { background: var(--ss-primary); color: #fff; }
.ss-qty-control input {
  width: 48px;
  border: none;
  border-left: 1px solid var(--ss-border);
  border-right: 1px solid var(--ss-border);
  text-align: center;
  font-family: var(--ss-font);
  font-size: 15px;
  font-weight: 600;
  padding: 0;
}
.ss-detail-add-btn {
  flex: 1;
  padding: 11px 18px;
  background: var(--ss-accent);
  color: #fff;
  border: none;
  border-radius: var(--ss-radius-sm);
  font-family: var(--ss-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ss-ease);
}
.ss-detail-add-btn:hover { background: var(--ss-accent-lt); }

.ss-loading { text-align:center; padding:48px; color:var(--ss-muted); }

/* ============================================================
   TOAST
============================================================ */
.ss-toast {
  position:fixed; bottom:24px; left:50%;
  transform:translateX(-50%) translateY(16px);
  background:var(--ss-primary); color:#fff;
  padding:11px 26px; border-radius:50px;
  font-family:var(--ss-font); font-size:13px; font-weight:500;
  z-index:9999; opacity:0;
  transition:all .3s ease;
  white-space:nowrap;
  box-shadow:0 8px 24px rgba(26,26,46,.25);
  pointer-events:none;
}
.ss-toast.ss-toast-show { opacity:1; transform:translateX(-50%) translateY(0); }
.ss-toast.ss-toast-error { background:var(--ss-accent); }

/* ============================================================
   RESPONSIVE
============================================================ */

/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 1100px) {
  .ss-inner-box { margin: 24px 6%; }
  .ss-cols-5 { grid-template-columns: repeat(4, 1fr); }
  .ss-pd-left { width: 280px; }
}

@media (max-width: 860px) {
  .ss-inner-box { margin: 18px 4%; border-radius: 14px; }
  :root { --ss-pad: 20px; }
  .ss-topbar { border-radius: 14px 14px 0 0; }
  .ss-cols-5, .ss-cols-4 { grid-template-columns: repeat(3, 1fr); }
  .ss-product-modal-content { height: 92vh !important; max-height: 92vh !important; }
  .ss-pd-body { flex-direction: column; overflow-y: auto; overflow-x: hidden; }
  .ss-pd-left { width: 100% !important; border-right: none; border-bottom: 1px solid var(--ss-border); overflow-y: visible; flex-shrink: 0; }
  .ss-pd-main-img-wrap { max-width: 260px; margin: 0 auto; }
  .ss-pd-right { flex: none !important; min-height: auto !important; overflow-y: visible !important; padding-bottom: 40px; }
}

@media (max-width: 640px) {
  .ss-inner-box { margin: 10px 3%; border-radius: 12px; }
  :root { --ss-pad: 14px; }
  .ss-topbar { border-radius: 12px 12px 0 0; padding: 12px var(--ss-pad); }
  .ss-shop-title { font-size: 16px; }
  .ss-cart-label { display: none; }
  .ss-cart-btn { padding: 8px 12px; }
  .ss-auth-btn, .ss-user-btn { padding: 8px 12px; font-size: 12px; }
  .ss-cols-5, .ss-cols-4, .ss-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .ss-product-grid { gap: 12px; }
  .ss-modal-content { padding: 20px 16px; }
  .ss-form-row { grid-template-columns: 1fr; }
  .ss-modal { padding: 0 !important; align-items: flex-end !important; }
  .ss-product-modal-content { width: 100% !important; border-radius: 20px 20px 0 0 !important; height: 94vh !important; max-height: 94vh !important; }
  .ss-pd-header { padding: 12px 16px; }
  .ss-pd-body { flex-direction: column; overflow-y: auto; overflow-x: hidden; }
  .ss-pd-left { width: 100% !important; border-right: none; border-bottom: 1px solid var(--ss-border); overflow-y: visible; flex-shrink: 0; padding: 16px; }
  .ss-pd-main-img-wrap { max-width: 200px; margin: 0 auto; }
  .ss-pd-thumbs { justify-content: center; }
  .ss-pd-right { flex: none !important; overflow-y: visible !important; padding: 16px 16px 40px; }
  .ss-pd-name { font-size: 16px; }
  .ss-pd-price { font-size: 22px; }
  .ss-pd-buy-box { padding: 14px; }
  .ss-cart-sidebar { width: 100vw; }
}

@media (max-width: 480px) {
  .ss-inner-box { margin: 8px 2%; border-radius: 10px; }
  :root { --ss-pad: 12px; }
}

@media (max-width: 380px) {
  .ss-product-grid { grid-template-columns: 1fr !important; }
  .ss-shop-title { font-size: 14px; }
}

.ss-toast {
  position:fixed; bottom:24px; left:50%;
  transform:translateX(-50%) translateY(16px);
  background:var(--ss-primary); color:#fff;
  padding:11px 26px; border-radius:50px;
  font-family:var(--ss-font); font-size:13px; font-weight:500;
  z-index:9999; opacity:0;
  transition:all .3s ease;
  white-space:nowrap;
  box-shadow:0 8px 24px rgba(26,26,46,.25);
  pointer-events:none;
}
.ss-toast.ss-toast-show { opacity:1; transform:translateX(-50%) translateY(0); }
.ss-toast.ss-toast-error { background:var(--ss-accent); }

/* ============================================================
   RESPONSIVE
============================================================ */

/* ---- Tablet landscape: 1100px ---- */
@media (max-width: 1100px) {
  .ss-inner-box { margin: 24px 6%; }
  .ss-cols-5 { grid-template-columns: repeat(4, 1fr); }
  .ss-pd-left { width: 280px; }
}

/* ---- Tablet portrait: 860px ---- */
@media (max-width: 860px) {
  .ss-inner-box { margin: 18px 4%; border-radius: 14px; }
  :root { --ss-pad: 20px; }
  .ss-topbar { border-radius: 14px 14px 0 0; }
  .ss-cols-5,
  .ss-cols-4 { grid-template-columns: repeat(3, 1fr); }

  /* Modal: stack vertically, whole body scrolls */
  .ss-product-modal-content { height: 92vh; max-height: 92vh; }
  .ss-pd-body {
    flex-direction: column;
    overflow-y: auto;  /* body itself scrolls on tablet */
  }
  .ss-pd-left {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--ss-border);
    overflow: visible;
    flex-shrink: 0;
  }
  .ss-pd-main-img-wrap { max-width: 260px; margin: 0 auto; }
  .ss-pd-right {
    overflow: visible; /* parent body scrolls */
    padding-bottom: 40px;
    flex: none;
  }
}

/* ---- Mobile large: 640px ---- */
@media (max-width: 640px) {
  .ss-inner-box { margin: 10px 3%; border-radius: 12px; }
  :root { --ss-pad: 14px; }
  .ss-topbar { border-radius: 12px 12px 0 0; padding: 12px var(--ss-pad); }
  .ss-shop-title { font-size: 16px; }
  .ss-cart-label { display: none; }
  .ss-cart-btn { padding: 8px 12px; }
  .ss-auth-btn, .ss-user-btn { padding: 8px 12px; font-size: 12px; }
  .ss-cols-5,
  .ss-cols-4,
  .ss-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .ss-product-grid { gap: 12px; }
  .ss-modal-content { padding: 20px 16px; }
  .ss-form-row { grid-template-columns: 1fr; }

  /* Modal: bottom sheet */
  .ss-modal { padding: 0; align-items: flex-end; }
  .ss-product-modal-content {
    width: 100%;
    border-radius: 20px 20px 0 0;
    height: 94vh;
    max-height: 94vh;
  }
  .ss-pd-header { padding: 12px 16px; }
  .ss-pd-body {
    flex-direction: column;
    overflow-y: auto;
  }
  .ss-pd-left {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--ss-border);
    overflow: visible;
    flex-shrink: 0;
    padding: 16px;
  }
  .ss-pd-main-img-wrap { max-width: 200px; margin: 0 auto; }
  .ss-pd-thumbs { justify-content: center; }
  .ss-pd-right {
    overflow: visible;
    padding: 16px 16px 40px;
    flex: none;
  }
  .ss-pd-name { font-size: 16px; }
  .ss-pd-price { font-size: 22px; }
  .ss-pd-buy-box { padding: 14px; }
  .ss-cart-sidebar { width: 100vw; }
}

/* ---- Mobile small: 480px ---- */
@media (max-width: 480px) {
  .ss-inner-box { margin: 8px 2%; border-radius: 10px; }
  :root { --ss-pad: 12px; }
}

/* ---- Mobile XS: 380px ---- */
@media (max-width: 380px) {
  .ss-product-grid { grid-template-columns: 1fr !important; }
  .ss-shop-title { font-size: 14px; }
}


/* ============================================================
   TOAST
============================================================ */
.ss-toast {
  position:fixed; bottom:24px; left:50%;
  transform:translateX(-50%) translateY(16px);
  background:var(--ss-primary); color:#fff;
  padding:11px 26px; border-radius:50px;
  font-family:var(--ss-font); font-size:13px; font-weight:500;
  z-index:9999; opacity:0;
  transition:all .3s ease;
  white-space:nowrap;
  box-shadow:0 8px 24px rgba(26,26,46,.25);
  pointer-events:none;
}
.ss-toast.ss-toast-show { opacity:1; transform:translateX(-50%) translateY(0); }
.ss-toast.ss-toast-error { background:var(--ss-accent); }

/* ============================================================
   RESPONSIVE
============================================================ */

/* ---- Tablet landscape: 1100px ---- */
@media (max-width: 1100px) {
  .ss-inner-box { margin: 24px 6%; }
  .ss-cols-5 { grid-template-columns: repeat(4, 1fr); }
  .ss-pd-left { width: 280px; }
}

/* ---- Tablet portrait: 860px ---- */
@media (max-width: 860px) {
  .ss-inner-box { margin: 18px 4%; border-radius: 14px; }
  :root { --ss-pad: 20px; }
  .ss-topbar { border-radius: 14px 14px 0 0; }
  .ss-cols-5,
  .ss-cols-4 { grid-template-columns: repeat(3, 1fr); }

  /* Stack product modal vertically */
  .ss-product-modal-content { height: 92vh; max-height: 92vh; }
  .ss-pd-body {
    flex-direction: column;  /* stack left above right */
    overflow-y: auto;        /* body itself scrolls */
    overflow-x: hidden;
  }
  .ss-pd-left {
    width: 100%;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid var(--ss-border);
    padding: 18px;
    overflow: visible;       /* no inner scroll, body scrolls */
  }
  .ss-pd-main-img-wrap { max-width: 280px; margin: 0 auto; }
  .ss-pd-right {
    flex: none;
    width: 100%;
    overflow: visible;       /* no inner scroll, body scrolls */
    padding: 18px;
    min-height: fit-content;
  }
}

/* ---- Mobile large: 640px ---- */
@media (max-width: 640px) {
  .ss-inner-box { margin: 10px 3%; border-radius: 12px; }
  :root { --ss-pad: 14px; }
  .ss-topbar { border-radius: 12px 12px 0 0; padding: 12px var(--ss-pad); }
  .ss-shop-title { font-size: 16px; }

  /* Topbar: icon-only cart button */
  .ss-cart-label { display: none; }
  .ss-cart-btn { padding: 8px 12px; }
  .ss-auth-btn, .ss-user-btn { padding: 8px 12px; font-size: 12px; }

  /* 2 columns on mobile */
  .ss-cols-5,
  .ss-cols-4,
  .ss-cols-3 { grid-template-columns: repeat(2, 1fr); }

  .ss-product-grid { gap: 12px; }

  /* Auth modal */
  .ss-modal-content { padding: 20px 16px; }
  .ss-form-row { grid-template-columns: 1fr; }

  /* Product modal: bottom sheet */
  .ss-modal { padding: 0; align-items: flex-end; }
  .ss-product-modal-content {
    width: 100%;
    border-radius: 20px 20px 0 0;
    height: 94vh;
    max-height: 94vh;
  }
  .ss-pd-header { padding: 12px 16px; flex-shrink: 0; }
  .ss-pd-body {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 0;
    min-height: 0;
  }
  .ss-pd-left {
    width: 100%;
    flex-shrink: 0;
    padding: 16px;
    border-right: none;
    border-bottom: 1px solid var(--ss-border);
    overflow: visible;
  }
  .ss-pd-main-img-wrap { max-width: 220px; margin: 0 auto; }
  .ss-pd-thumbs { justify-content: center; }
  .ss-pd-right {
    flex: none;
    width: 100%;
    padding: 16px;
    overflow: visible;
    min-height: fit-content;
  }
  .ss-pd-name { font-size: 16px; }
  .ss-pd-price { font-size: 22px; }
  .ss-pd-buy-box { padding: 14px; }

  /* Cart sidebar full width */
  .ss-cart-sidebar { width: 100vw; }
}

/* ---- Mobile small: 480px ---- */
@media (max-width: 480px) {
  .ss-inner-box { margin: 8px 2%; border-radius: 10px; }
  :root { --ss-pad: 12px; }
  .ss-cols-5,
  .ss-cols-4,
  .ss-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Mobile XS: 380px — single column ---- */
@media (max-width: 380px) {
  .ss-product-grid { grid-template-columns: 1fr !important; }
  .ss-shop-title { font-size: 14px; }
  .ss-auth-btn span, .ss-user-btn span { display: none; }
}
