:root {
  --blue: #0076e3;
  --blue-hover: #0060be;
  --blue-soft: #eff6ff;
  --navy: #132742;
  --ink: #1e293b;
  --gray: #64748b;
  --gray-light: #94a3b8;
  --border: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --green: #10b981;
  --green-mint: #d1fae5;
  --green-mint-text: #065f46;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(15,23,42,0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg-soft);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}


/* =========================================
   CONTAINER & VIEW SWITCHER
========================================= */

.app-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 120px;
}

.view-section {
  display: none;
  width: 100%;
}

.view-section.active {
  display: block;
}


/* =========================================
   BACK BUTTON
========================================= */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  margin-bottom: 24px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.back-btn:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}


/* =========================================
   HEADER
========================================= */

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.shop-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--navy);
}

.shop-tagline {
  font-size: 14px;
  color: var(--gray);
  margin: 0 0 16px;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 13.5px;
  color: var(--gray);
}

.contact-row .item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.contact-row svg {
  width: 15px;
  height: 15px;
  color: var(--blue);
}

.phone-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  background: var(--bg);
}

.phone-pill svg {
  width: 15px;
  height: 15px;
  color: var(--gray);
}

.shop-logo-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, #6d28d9, #2e1065 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(109, 40, 217, 0.25);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.3;
}


/* =========================================
   SEARCH
========================================= */

.search-wrap {
  margin: 22px 0 16px;
  width: 100%;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--gray-light);
}

.search-box input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--blue);
}


/* =========================================
   CATEGORY FILTERS
========================================= */

.cat-filters {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scrollbar-width: thin;
  width: 100%;
}

.cat-pill {
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s;
}

.cat-pill.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
}


/* =========================================
   PRODUCT GRID
========================================= */

.product-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-top: 14px;
}

@media (max-width: 1140px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 880px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 620px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 360px) {
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* =========================================
   PRODUCT CARD
========================================= */

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  width: 100%;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1/0.95;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.card:hover .card-media img {
  transform: scale(1.05);
}

.card-name {
  margin: 10px 0 2px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.card-code {
  font-size: 11px;
  color: var(--gray);
  margin: 0 0 10px;
}

.card-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}

.card-price {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.add-btn {
  border: 1.5px solid var(--blue);
  color: var(--blue);
  background: var(--bg);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  margin-left: auto;
}

.add-btn:hover {
  background: var(--blue);
  color: #fff;
}

.add-btn.added {
  background: var(--blue);
  color: #fff;
}


/* =========================================
   PRODUCT DETAIL
========================================= */

.product-detail-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: grid;
  grid-template-columns: 80px 380px 1fr;
  gap: 28px;
  box-shadow: var(--shadow-sm);
  align-items: start;
}

@media (max-width: 960px) {
  .product-detail-card {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px;
  }
}

.detail-thumbs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thumb-box {
  width: 76px;
  height: 76px;
  border: 2px solid var(--blue);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f8fafc;
  cursor: pointer;
}

.thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-main-img {
  width: 100%;
  aspect-ratio: 1/1;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-main-img img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
}

.detail-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 10px;
}

.detail-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 22px;
}

.qty-pill-lg {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  border: 1.5px solid var(--blue);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  width: 190px;
  margin-bottom: 28px;
}

.qty-pill-lg button {
  background: transparent;
  border: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  padding: 2px 8px;
}

.qty-pill-lg .qty-count {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
}

.section-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 10px;
}

.about-product-row {
  display: flex;
  gap: 32px;
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.about-product-row strong {
  color: var(--navy);
  font-weight: 700;
}

.seller-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
  gap: 16px;
}

.seller-left h4 {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--navy);
}

.seller-left .location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--blue);
  margin-bottom: 12px;
}

.seller-left .location svg {
  width: 14px;
  height: 14px;
}

.seller-phone-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.seller-phone-btn svg {
  width: 14px;
  height: 14px;
  color: var(--gray);
}

.seller-logo-small {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, #6d28d9, #2e1065 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}


/* =========================================
   CHECKOUT
========================================= */

.checkout-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }
}

.checkout-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.checkout-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.checkout-card-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
}

.checkout-card-header .item-badge {
  font-size: 13px;
  color: var(--gray);
  font-weight: 500;
}

.co-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.co-item:last-child {
  border-bottom: 0;
}

.co-item-img {
  width: 58px;
  height: 58px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.co-item-img img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.co-item-details {
  flex: 1;
  min-width: 0;
}

.co-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.co-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.co-remove-btn {
  background: transparent;
  border: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.co-qty-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--blue);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  flex-shrink: 0;
}

.co-qty-pill button {
  background: transparent;
  border: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  padding: 0 4px;
  display: flex;
  align-items: center;
}

.co-qty-pill .qty-val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  min-width: 14px;
  text-align: center;
}

.form-input-group {
  margin-bottom: 14px;
}

.phone-input-row {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}

.phone-prefix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: #f8fafc;
  border-right: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}

.phone-input-row input {
  border: 0 !important;
  border-radius: 0 !important;
  flex: 1;
}

.co-input,
.co-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background: var(--bg);
}

.co-input:focus,
.co-textarea:focus,
.phone-input-row:focus-within {
  border-color: var(--blue);
}

.co-textarea {
  min-height: 80px;
  resize: vertical;
}

.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 12px;
}

.price-row strong {
  color: var(--ink);
  font-weight: 700;
}

.price-divider {
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

.to-pay-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
}

.mint-notice-banner {
  background: var(--green-mint);
  color: var(--green-mint-text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

.place-order-btn {
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: 0;
  border-radius: var(--radius-md);
  padding: 14px;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.place-order-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.place-order-btn .main-text {
  font-size: 16px;
  font-weight: 800;
  display: block;
}

.place-order-btn .sub-text {
  font-size: 12px;
  opacity: 0.85;
  font-weight: 500;
  margin-top: 3px;
  display: block;
}


/* =========================================
   FLOATING CART
========================================= */

.floating-cart-pill {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--blue);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 25px rgba(0, 118, 227, 0.35);
  z-index: 9999;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 14px;
  font-weight: 700;
  user-select: none;
}

.floating-cart-pill.show {
  transform: translateX(-50%) translateY(0);
}

.pill-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.35);
}

.pill-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-icon-badge {
  position: relative;
  display: flex;
  align-items: center;
}

.cart-icon-badge svg {
  width: 20px;
  height: 20px;
}

.cart-count-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
}