/* ============================================
   File: assets/css/style.css
   StartInvestment - Fashion Store theme
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #e23744;
  --primary-dark: #c52d39;
  --dark: #1c1c1c;
  --bg: #ffffff;
  --grey: #f5f5f5;
  --text: #1a1a1a;
  --muted: #888;
  --border: #e8e8e8;
  --green: #1ba672;
}

body {
  font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--grey);
  color: var(--text);
  padding-bottom: 80px;
}
.hidden { display: none !important; }

/* ---------- Header ---------- */
.header {
  background: var(--dark);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-logo { font-size: 24px; }
.brand-name { font-weight: 800; font-size: 17px; color: #fff; }
.brand-sub { font-size: 10px; color: #bbb; }

.search-box { flex: 1; display: flex; background: #fff; border-radius: 8px; overflow: hidden; }
.search-box input { flex: 1; border: none; outline: none; padding: 10px 12px; font-size: 14px; }
.search-box button { border: none; background: #fff; padding: 0 14px; cursor: pointer; font-size: 16px; }

.cart-btn { position: relative; text-decoration: none; font-size: 22px; color: #fff; }
.cart-count {
  position: absolute; top: -8px; right: -10px;
  background: var(--primary); color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.back-link { text-decoration: none; color: #fff; font-weight: 600; }

/* ---------- Category bar ---------- */
.cat-bar {
  background: #fff; padding: 10px 16px;
  display: flex; gap: 8px; overflow-x: auto;
  border-bottom: 1px solid var(--border);
}
.chip {
  white-space: nowrap; text-decoration: none;
  padding: 6px 16px; border-radius: 20px;
  background: var(--grey); color: var(--text);
  font-size: 13px; font-weight: 600;
}
.chip.active { background: var(--primary); color: #fff; }

/* ---------- Banner ---------- */
.banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; padding: 24px 16px; text-align: center;
}
.banner h1 { font-size: 21px; }
.banner p { font-size: 13px; opacity: .9; margin-top: 4px; }

/* ---------- Container ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }
.section-title { font-size: 18px; margin-bottom: 14px; }
.empty { color: var(--muted); text-align: center; padding: 40px; }

/* ---------- Product Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  text-decoration: none; color: var(--text);
  display: flex; flex-direction: column;
  position: relative; transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.discount-tag {
  position: absolute; top: 8px; left: 8px;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 3px 7px; border-radius: 5px; z-index: 2;
}
.discount-tag.big { font-size: 12px; padding: 5px 10px; }
.card-img {
  height: 170px; background: #fafafa;
  display: flex; align-items: center; justify-content: center;
}
.card-img img { max-height: 170px; max-width: 100%; object-fit: contain; }
.card-body { padding: 10px; display: flex; flex-direction: column; flex: 1; }
.card-name { font-size: 14px; font-weight: 600; line-height: 1.3; height: 36px; overflow: hidden; }
.card-cat { font-size: 11px; color: var(--muted); margin: 4px 0; }
.card-price-row { display: flex; align-items: center; gap: 6px; margin: 6px 0 8px; }
.price { font-weight: 700; font-size: 16px; }
.mrp { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.view-btn {
  margin-top: auto; text-align: center;
  background: var(--dark); color: #fff;
  padding: 7px; border-radius: 7px; font-size: 13px; font-weight: 600;
}

/* ---------- Floating Cart ---------- */
.floating-cart {
  position: fixed; bottom: 16px; left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 1068px;
  background: var(--primary); color: #fff; text-decoration: none;
  padding: 14px 18px; border-radius: 12px;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.2); z-index: 90;
}

/* ============================================
   PRODUCT DETAIL PAGE
   ============================================ */
.product-page { max-width: 1000px; }
.product-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  background: #fff; border-radius: 12px; padding: 20px;
  border: 1px solid var(--border);
}
.main-img {
  position: relative; background: #fafafa; border-radius: 10px;
  height: 380px; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.main-img img { max-height: 380px; max-width: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; }
.thumb {
  width: 64px; height: 64px; object-fit: contain;
  background: #fafafa; border: 2px solid var(--border);
  border-radius: 8px; cursor: pointer; padding: 4px;
}
.thumb.active { border-color: var(--primary); }

.p-cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.p-name { font-size: 22px; margin: 6px 0 12px; }
.p-price-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.p-price { font-size: 26px; font-weight: 800; }
.p-mrp { font-size: 16px; color: var(--muted); text-decoration: line-through; }
.p-off { font-size: 14px; color: var(--green); font-weight: 700; }
.in-stock { color: var(--green); font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.out-stock { color: var(--primary); font-size: 13px; font-weight: 600; margin-bottom: 16px; }

.size-section { margin: 18px 0; }
.size-label { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.size-options { display: flex; flex-wrap: wrap; gap: 10px; }
.size-btn {
  min-width: 48px; height: 44px; padding: 0 12px;
  border: 1.5px solid var(--border); background: #fff;
  border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 600;
}
.size-btn:hover { border-color: var(--dark); }
.size-btn.selected { border-color: var(--primary); background: var(--primary); color: #fff; }
.size-error { color: var(--primary); font-size: 13px; margin-top: 8px; }

.p-desc { margin: 18px 0; padding: 16px 0; border-top: 1px solid var(--border); }
.p-desc h3 { font-size: 15px; margin-bottom: 8px; }
.p-desc p { font-size: 14px; color: #555; line-height: 1.6; }

.btn-add-cart {
  width: 100%; background: var(--primary); color: #fff;
  border: none; padding: 15px; border-radius: 10px;
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.btn-add-cart:hover { background: var(--primary-dark); }
.btn-add-cart.added { background: var(--green); }
.btn-add-cart.disabled { background: var(--muted); cursor: not-allowed; }

/* ============================================
   CART PAGE
   ============================================ */
.cart-page { max-width: 700px; }
.cart-item {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.cart-item img { width: 70px; height: 70px; object-fit: contain; background: #fafafa; border-radius: 6px; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-size { font-size: 12px; color: var(--muted); margin: 3px 0; }
.cart-item-price { font-weight: 700; margin-top: 4px; }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.remove-btn { background: none; border: none; color: var(--primary); font-size: 12px; cursor: pointer; font-weight: 600; }

.qty-control {
  display: flex; align-items: center; gap: 0;
  background: var(--dark); border-radius: 8px; overflow: hidden; width: 100px;
}
.qty-control button {
  background: var(--dark); color: #fff; border: none;
  width: 34px; height: 34px; font-size: 18px; cursor: pointer;
}
.qty-control .qty-num { color: #fff; font-weight: 700; font-size: 14px; flex: 1; text-align: center; }

.empty-cart { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 60px; }
.empty-cart p { color: var(--muted); margin: 14px 0; }

.bill-box { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 16px 0; }
.bill-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.bill-row .free { color: var(--green); font-weight: 700; }
.bill-total { border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 16px; }

.btn-primary, .btn-checkout, .btn-pay {
  display: block; width: 100%; text-align: center;
  background: var(--primary); color: #fff; text-decoration: none;
  border: none; padding: 15px; border-radius: 12px;
  font-weight: 700; font-size: 16px; cursor: pointer;
}
.btn-checkout:hover, .btn-pay:hover, .btn-primary:hover { background: var(--primary-dark); }
.btn-pay:disabled { background: var(--muted); cursor: not-allowed; }
.pay-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ============================================
   CHECKOUT PAGE
   ============================================ */
.checkout-page { max-width: 640px; }
.form-section-title { margin-bottom: 14px; font-size: 17px; }
.address-form { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.form-group { margin-bottom: 14px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input { width: 100%; padding: 11px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; }
.form-group input:focus { border-color: var(--primary); }

.pay-methods { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.pay-method { cursor: pointer; }
.pay-method input { display: none; }
.pay-method-box {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--border); border-radius: 10px; padding: 14px;
}
.pay-method input:checked + .pay-method-box { border-color: var(--primary); background: #fff5f5; }
.pay-icon { font-size: 26px; }
.pay-title { font-weight: 700; font-size: 14px; }
.pay-sub { font-size: 12px; color: var(--muted); }

/* ============================================
   SUCCESS PAGE
   ============================================ */
.success-page { max-width: 560px; text-align: center; padding-top: 30px; }
.success-icon { font-size: 64px; }
.success-page h2 { margin: 12px 0 6px; }
.success-sub { color: var(--muted); margin-bottom: 20px; }
.order-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: left; margin-bottom: 14px; }
.order-card h4 { margin-bottom: 10px; font-size: 15px; }
.order-card p { font-size: 14px; color: #444; margin: 2px 0; }
.order-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.order-row .paid { color: var(--green); }
.cod-badge { color: #b8860b; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 700px) {
  .product-detail { grid-template-columns: 1fr; }
  .main-img { height: 300px; }
  .main-img img { max-height: 300px; }
}
@media (max-width: 600px) {
  .brand-sub { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card-img { height: 140px; }
  .card-img img { max-height: 140px; }
}