/* ========================================
   MilliCraft - Shop Stylesheet (v2)
   Exo 2 + Inter typography with 100% Azerbaijani glyph support.
======================================== */

/* ===== SHOP LAYOUT ===== */
.page-hero {
  position: relative;
  background:
    linear-gradient(to bottom, rgba(7,9,14,0.7) 0%, rgba(7,9,14,0.85) 75%, var(--bg-primary) 100%),
    url('../magaza backround.jpg') center/cover no-repeat;
  padding: calc(var(--nav-h) + 4.5rem) 0 3.5rem;
  border-bottom: 1px solid var(--border);
}

.shop-page-wrap {
  padding-top: calc(var(--nav-h) + 2rem);
  min-height: 100vh;
}

.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}

/* ===== SIDEBAR ===== */
.shop-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: calc(var(--nav-h) + 1.25rem);
  box-shadow: var(--shadow-card);
}

.sidebar-head {
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-head h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}

.sidebar-nav {
  padding: 0.85rem;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.sidebar-nav li a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  transform: translateX(2px);
}
.sidebar-nav li a.active {
  background: rgba(47, 211, 107, 0.12);
  color: #fff;
  font-weight: 600;
}
.sidebar-nav li a.active::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: var(--accent-green);
}
.sidebar-nav li a .s-icon {
  font-size: 1.15rem; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-nav li a .s-count {
  margin-left: auto;
  background: rgba(47, 211, 107, 0.15);
  color: var(--accent-green-light);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.75rem 0.5rem;
}

/* ===== PRODUCTS AREA ===== */
.shop-content { min-width: 0; }

.shop-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.shop-topbar-left h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
}
.shop-topbar-left p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 2px;
}

.shop-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}
.filter-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}
.filter-pill.active {
  background: rgba(47, 211, 107, 0.15);
  border-color: rgba(47, 211, 107, 0.4);
  color: var(--accent-green-light);
}

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

.product-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}
.product-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-5px);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6), 0 0 24px -6px rgba(47, 211, 107, 0.18);
}

/* Product Image */
.product-img-wrap {
  aspect-ratio: 1.1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  background: radial-gradient(circle at center, rgba(47, 211, 107, 0.08) 0%, transparent 70%);
}
.product-img-wrap .p-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
.product-img-wrap img {
  max-width: 78%;
  max-height: 78%;
  object-fit: contain;
  image-rendering: pixelated;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
  position: relative; z-index: 1;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
}
.product-img-wrap .p-emoji {
  font-size: 3.8rem;
  position: relative; z-index: 1;
  transition: transform 0.4s ease;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.5));
}
.product-card:hover .product-img-wrap img,
.product-card:hover .p-emoji {
  transform: scale(1.12) translateY(-4px);
}

/* Badge */
.p-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 4px 10px; border-radius: 12px;
  font-family: var(--font-display);
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.badge-hot    { background: linear-gradient(180deg, #ef4444, #dc2626); color: #fff; }
.badge-new    { background: linear-gradient(180deg, var(--accent-green), var(--accent-green-dark)); color: #fff; }
.badge-sale   { background: linear-gradient(180deg, var(--accent-gold), var(--accent-gold-dark)); color: #1a1000; }
.badge-limit  { background: linear-gradient(180deg, var(--accent-purple), #7c3aed); color: #fff; }
.badge-best   { background: linear-gradient(180deg, var(--accent-blue), #2563eb); color: #fff; }

/* Product Info */
.product-info {
  padding: 1.2rem 1.3rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.product-cat {
  font-family: var(--font-display);
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent-green-light);
}
.product-name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.08rem; color: #fff;
  line-height: 1.3;
}
.product-desc {
  font-size: 0.85rem; color: var(--text-secondary);
  line-height: 1.55; flex: 1; margin: 0.2rem 0;
}

/* Product Footer */
.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.price-wrap { display: flex; flex-direction: column; }
.price-old {
  font-size: 0.78rem; color: var(--text-muted);
  text-decoration: line-through; line-height: 1;
}
.price-now {
  font-family: var(--font-display);
  font-size: 1.18rem; font-weight: 800;
  color: var(--accent-gold); line-height: 1.2;
}
.price-free {
  font-family: var(--font-display);
  font-size: 1.18rem; font-weight: 800;
  color: var(--accent-green-light);
}

.btn-add {
  background: rgba(47, 211, 107, 0.12);
  border: 1px solid rgba(47, 211, 107, 0.3);
  color: var(--accent-green-light);
  padding: 8px 15px; border-radius: 9px;
  font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-body); white-space: nowrap;
}
.btn-add:hover {
  background: linear-gradient(180deg, var(--accent-green), var(--accent-green-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(47, 211, 107, 0.5);
  transform: translateY(-1px);
}
.btn-add.added {
  background: rgba(47, 211, 107, 0.25);
  border-color: var(--accent-green);
  color: var(--accent-green-light);
  cursor: default;
}

/* ===== SHOP INDEX CATEGORIES ===== */
.shop-cats-section { padding-top: calc(var(--nav-h) + 2rem); min-height: 100vh; }
.shop-cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.shop-cat-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: var(--transition);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  position: relative;
}
.shop-cat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.6), 0 0 30px -8px rgba(47, 211, 107, 0.25);
}
.shop-cat-banner {
  height: 160px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.shop-cat-banner img {
  transition: transform 0.5s ease;
}
.shop-cat-card:hover .shop-cat-banner img {
  transform: scale(1.08);
}
.shop-cat-banner .cat-emoji { font-size: 4.8rem; position: relative; z-index: 1; }
.shop-cat-banner .cat-glow {
  position: absolute; width: 140px; height: 140px; border-radius: 50%;
  opacity: 0.35; filter: blur(35px);
}
.shop-cat-body { padding: 1.35rem 1.5rem 1.6rem; }
.shop-cat-title {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 800; margin-bottom: 0.45rem;
  color: #fff; letter-spacing: -0.01em;
}
.shop-cat-desc { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6; margin-bottom: 0.95rem; }
.shop-cat-meta {
  display: flex; align-items: center; justify-content: space-between;
}
.shop-cat-count {
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
}
.shop-cat-arrow {
  width: 32px; height: 32px; border-radius: 9px;
  background: rgba(47, 211, 107, 0.12); border: 1px solid rgba(47, 211, 107, 0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-green-light); font-size: 0.95rem; font-weight: 800;
  transition: var(--transition);
}
.shop-cat-card:hover .shop-cat-arrow {
  background: var(--accent-green);
  color: #fff;
  transform: translateX(3px);
}

/* ===== CART SIDEBAR ===== */
.cart-overlay {
  position: fixed; inset: 0; z-index: 1998;
  background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-sidebar {
  position: fixed; top: 0; right: 0; height: 100vh;
  width: 400px; max-width: 100vw; background: var(--bg-secondary);
  border-left: 1px solid var(--border-strong); z-index: 1999;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.8);
}
.cart-sidebar.open { transform: translateX(0); }

.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.35rem 1.6rem;
  border-bottom: 1px solid var(--border);
}
.cart-head-left { display: flex; align-items: center; gap: 10px; }
.cart-head-left h3 {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 800; color: #fff;
}
.cart-count-badge {
  background: var(--accent-green); color: #05210f;
  font-size: 0.74rem; font-weight: 800;
  padding: 2px 8px; border-radius: 12px;
}

.cart-close-btn {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: var(--transition);
}
.cart-close-btn:hover {
  background: rgba(248, 113, 113, 0.15); border-color: rgba(248, 113, 113, 0.4);
  color: var(--accent-red);
}

.cart-body {
  flex: 1; overflow-y: auto; padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.85rem;
}

.cart-empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; color: var(--text-muted); gap: 0.75rem;
}
.cart-empty-state .ce-icon { font-size: 3.5rem; opacity: 0.35; }
.cart-empty-state p { font-size: 0.95rem; color: var(--text-secondary); }
.cart-empty-state small { font-size: 0.82rem; }

.cart-item {
  display: flex; align-items: center; gap: 0.95rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.9rem;
  transition: var(--transition);
}
.cart-item:hover { border-color: var(--border-hover); }
.ci-icon {
  width: 52px; height: 52px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; flex-shrink: 0;
}
.ci-icon img {
  max-width: 85%; max-height: 85%;
  object-fit: contain; image-rendering: pixelated;
}
.ci-info { flex: 1; min-width: 0; }
.ci-name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 0.95rem; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.ci-price {
  font-family: var(--font-display);
  font-size: 0.95rem; font-weight: 700; color: var(--accent-gold);
}
.ci-remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.05rem; padding: 6px;
  border-radius: 6px; transition: var(--transition); flex-shrink: 0;
}
.ci-remove:hover { color: var(--accent-red); background: rgba(248, 113, 113, 0.12); }

.cart-foot {
  padding: 1.25rem 1.6rem;
  border-top: 1px solid var(--border);
  background: rgba(11, 16, 26, 0.8);
}
.cart-summary { margin-bottom: 1rem; }
.cart-sum-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.5rem; font-size: 0.9rem;
}
.cart-sum-row.total {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem; margin-top: 0.6rem;
}
.cart-sum-row.total .label { font-weight: 700; font-size: 1rem; color: #fff; }
.cart-sum-row.total .value {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 800; color: var(--accent-gold);
}
.cart-sum-row .label { color: var(--text-secondary); }
.cart-sum-row .value { font-weight: 600; }

.btn-checkout {
  width: 100%;
  background: linear-gradient(180deg, var(--accent-gold), var(--accent-gold-dark));
  border: none; color: #1a1000; padding: 14px;
  border-radius: 11px; font-size: 0.98rem; font-weight: 800;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  box-shadow: var(--btn-3d), 0 8px 24px -6px rgba(251, 191, 36, 0.5);
}
.btn-checkout:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn-view-cart {
  display: block; text-align: center;
  color: var(--text-muted); font-size: 0.85rem; font-weight: 500;
  margin-top: 0.85rem; transition: var(--transition);
}
.btn-view-cart:hover { color: var(--accent-green-light); }

/* ===== CART PAGE ===== */
.cart-page-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem; align-items: start;
}

.cart-table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-card);
}
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th {
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-display);
  font-size: 0.74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-muted); padding: 14px 18px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.cart-table td { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cart-table tr:last-child td { border-bottom: none; }
.cart-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.ct-product { display: flex; align-items: center; gap: 1rem; }
.ct-img {
  width: 58px; height: 58px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
}
.ct-name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1rem; color: #fff;
}
.ct-cat { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.ct-price { font-family: var(--font-display); font-weight: 700; color: var(--accent-gold); font-size: 1.05rem; }

.qty-ctrl {
  display: flex; align-items: center; gap: 0; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border-strong); width: fit-content;
}
.qty-ctrl button {
  background: rgba(255, 255, 255, 0.04); border: none; color: var(--text-primary);
  width: 32px; height: 32px; cursor: pointer; font-size: 1rem;
  transition: var(--transition); display: flex; align-items: center; justify-content: center;
}
.qty-ctrl button:hover { background: rgba(47, 211, 107, 0.18); color: var(--accent-green-light); }
.qty-ctrl span {
  padding: 0 14px; font-weight: 700; font-size: 0.9rem;
  min-width: 40px; text-align: center;
  border-left: 1px solid var(--border-strong); border-right: 1px solid var(--border-strong);
  line-height: 32px;
}

.ct-remove {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.15rem; padding: 7px; border-radius: 7px;
  transition: var(--transition);
}
.ct-remove:hover { color: var(--accent-red); background: rgba(248, 113, 113, 0.12); }

.cart-summary-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  position: sticky; top: calc(var(--nav-h) + 1.25rem);
  box-shadow: var(--shadow-card);
}
.cart-summary-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 800; margin-bottom: 1.35rem; color: #fff;
}

/* ===== RANK CARDS ===== */
.ranks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.4rem;
}
.rank-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.rank-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.7);
}
.rank-card.featured {
  border-width: 2px;
  border-color: rgba(251, 191, 36, 0.45) !important;
}
.rank-banner {
  padding: 2.2rem 1.5rem 1.6rem;
  text-align: center; position: relative; overflow: hidden;
}
.rank-banner .rank-crown { font-size: 2.8rem; margin-bottom: 0.5rem; }
.rank-banner .rank-name {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 900; letter-spacing: 0.04em;
}
.rank-banner .rank-glow {
  position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%);
  width: 160px; height: 70px; border-radius: 50%;
  opacity: 0.35; filter: blur(25px);
}
.rank-card-body { padding: 1.35rem 1.6rem 1.6rem; background: var(--bg-card); }
.rank-perks { margin-bottom: 1.35rem; }
.rank-perk {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.88rem; color: var(--text-secondary);
  padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.rank-perk:last-child { border-bottom: none; }
.rank-perk .perk-icon { font-size: 0.9rem; font-weight: 800; flex-shrink: 0; }
.rank-price-row { display: flex; align-items: center; justify-content: space-between; }
.rank-price {
  font-family: var(--font-display);
  font-size: 1.45rem; font-weight: 800; color: var(--accent-gold);
}
.featured-badge {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  background: linear-gradient(180deg, var(--accent-gold), var(--accent-gold-dark));
  color: #1a1000;
  font-family: var(--font-display);
  font-size: 0.7rem; font-weight: 800;
  padding: 4px 10px; border-radius: 20px; text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .shop-sidebar { position: static; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.75rem; }
  .sidebar-nav li a { padding: 8px 14px; }
  .cart-page-layout { grid-template-columns: 1fr; }
  .cart-summary-card { position: static; }
}
@media (max-width: 540px) {
  .cart-sidebar { width: 100%; }
  .products-grid { grid-template-columns: 1fr; }
}
