/* Go Mobile Hub — page-specific CSS module. */
/* =========================
   Buy Page / Stock Cards
========================= */
.buy-page {
    width: 90%;
    max-width: 1300px;
    margin: 30px auto 60px;
}

.buy-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.buy-page-header h1 {
    font-size: 36px;
    color: #0F172A;
    margin-bottom: 6px;
}

.buy-subtitle {
    color: #64748B;
    font-size: 15px;
}

.buy-search-box {
    width: 300px;
    height: 48px;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 0 16px;
}

.buy-search-box input {
    width: 100%;
    border: none;
    outline: none;
    margin-left: 10px;
    font-size: 15px;
    font-family: inherit;
}

.buy-search-box i {
    color: #64748B;
}

.buy-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.filter-chip {
    border: 1px solid #E2E8F0;
    background: #fff;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    padding: 8px 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.2s;
}

.filter-chip:hover {
    border-color: #2563EB;
    color: #2563EB;
}

.filter-chip.active {
    background: #2563EB;
    border-color: #2563EB;
    color: #fff;
}

.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 22px;
}

.stock-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: 0.3s;
}

.stock-card:hover {
    border-color: #2563EB;
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.12);
}

.stock-img-wrap {
    position: relative;
    height: 180px;
    background: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.stock-img-wrap img {
    max-height: 140px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
}

.condition-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.condition-badge.excellent {
    background: #DCFCE7;
    color: #15803D;
}

.condition-badge.good {
    background: #DBEAFE;
    color: #1D4ED8;
}

.condition-badge.fair {
    background: #FFEDD5;
    color: #C2410C;
}

.stock-body {
    padding: 18px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stock-body h3 {
    font-size: 16px;
    color: #0F172A;
    margin-bottom: 10px;
    line-height: 1.3;
}

.stock-specs {
    list-style: none;
    margin-bottom: 16px;
    flex: 1;
}

.stock-specs li {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-specs li i {
    width: 16px;
    color: #94A3B8;
    font-size: 12px;
}

.stock-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid #F1F5F9;
    padding-top: 14px;
}

.stock-price {
    font-size: 18px;
    font-weight: 800;
    color: #0F172A;
}

.stock-btn {
    background: #2563EB;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 8px;
    transition: 0.2s;
    white-space: nowrap;
}

.stock-btn:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
}

.stock-empty {
    text-align: center;
    color: #64748B;
    padding: 40px 20px;
    font-size: 15px;
}

@media (max-width: 768px) {
    .buy-page-header h1 {
        font-size: 28px;
    }

    .buy-search-box {
        width: 100%;
    }

    .stock-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .stock-img-wrap {
        height: 140px;
    }

    .stock-img-wrap img {
        max-height: 110px;
    }

    .stock-body h3 {
        font-size: 14px;
    }

    .stock-price {
        font-size: 15px;
    }

    .stock-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

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

.device-search {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 650px;
    margin: 20px auto;
}

.device-search input {
    flex: 1;
    padding: 15px 18px;
    border: 1px solid #ddd;
    border-radius: 10px 0 0 10px;
    outline: none;
    font-size: 16px;
}

.device-search input:focus {
    border-color: #111;
}

.device-search button {
    padding: 15px 25px;
    border: none;
    background: #111;
    color: white;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    font-size: 16px;
}

.device-search button:hover {
    background: #333;
}

/* Mobile */
@media (max-width: 600px) {

    .device-search {
        flex-direction: column;
        gap: 10px;
    }

    .device-search input {
        width: 100%;
        box-sizing: border-box;
        border-radius: 10px;
    }

    .device-search button {
        width: 100%;
        border-radius: 10px;
    }
}


/* =====================================================
   BUY PAGE – Dynamic Inventory Enhancements
   (extends existing .buy-page / .stock-card rules)
   ===================================================== */

/* Filter panel wrapper */
.buy-filters-wrap {
  margin-bottom: 28px;
}

.filters-toggle {
  display: none;
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #0F172A;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.filters-toggle .chevron {
  transition: transform 0.22s ease;
}

.filters-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.buy-filters-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.price-range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.price-range-inputs input {
  width: 90px;
  padding: 8px 10px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.price-range-inputs input:focus {
  outline: none;
  border-color: #2563EB;
}

.price-sep {
  color: #94A3B8;
}

.price-apply-btn {
  padding: 8px 14px;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.price-apply-btn:hover {
  background: #1D4ED8;
}

.clear-filters-btn {
  align-self: flex-end;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: #64748B;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: 0.2s;
}

.clear-filters-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* Loading / Error */
.stock-loading,
.stock-error {
  text-align: center;
  padding: 48px 16px;
  color: #64748B;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #E2E8F0;
  border-top-color: #2563EB;
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: gmh-spin 0.7s linear infinite;
}

@keyframes gmh-spin {
  to { transform: rotate(360deg); }
}

.stock-error i {
  font-size: 28px;
  color: #f59e0b;
  margin-bottom: 10px;
}

.retry-btn {
  margin-top: 14px;
  padding: 10px 22px;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.retry-btn:hover {
  background: #1D4ED8;
}

.stock-empty {
  text-align: center;
  color: #64748B;
  padding: 40px 20px;
  font-size: 15px;
  background: #fff;
  border-radius: 16px;
  border: 1px dashed #E2E8F0;
}

/* Enhanced stock card */
.stock-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.stock-card:hover {
  border-color: #2563EB;
  transform: translateY(-5px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.12);
}

.stock-img-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
}

.stock-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

/* Status badge (top-right) */
.status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  z-index: 2;
}

.status-badge.available {
  background: #DCFCE7;
  color: #166534;
}

.status-badge.sold {
  background: #FEE2E2;
  color: #991B1B;
}

.status-badge.reserved {
  background: #FEF3C7;
  color: #92400E;
}

/* Condition badge colours */
.condition-badge.like-new {
  background: #DCFCE7;
  color: #166534;
}

.condition-badge.excellent {
  background: #DBEAFE;
  color: #1E40AF;
}

.condition-badge.good {
  background: #FFEDD5;
  color: #C2410C;
}

.condition-badge.fair {
  background: #FEE2E2;
  color: #991B1B;
}

.stock-brand {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2563EB;
  margin-bottom: 2px;
}

.stock-desc {
  font-size: 13px;
  color: #64748B;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.stock-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.meta-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #F1F5F9;
  color: #64748B;
  font-weight: 500;
}

.meta-tag.yes {
  background: #DCFCE7;
  color: #166534;
}

.meta-tag.no {
  background: #F1F5F9;
  color: #94A3B8;
}

.stock-btn.sold-out,
.stock-btn.reserved {
  background: #94A3B8;
  pointer-events: none;
  cursor: not-allowed;
}

.stock-btn.reserved {
  background: #D97706;
}

.stock-card.is-sold .stock-img-wrap::after,
.stock-card.is-reserved .stock-img-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

/* Buy page responsive */
@media (max-width: 768px) {
  .filters-toggle {
    display: flex;
  }

  .buy-filters-panel {
    display: none;
    flex-direction: column;
    margin-top: 12px;
  }

  .buy-filters-panel.open {
    display: flex;
  }

  .stock-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .stock-img-wrap {
    height: 150px;
    padding: 12px;
  }
}

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

  .stock-img-wrap {
    height: 180px;
  }

  .price-range-inputs {
    flex-wrap: wrap;
  }
}


/* Buy marketplace / product / cart / checkout */
.stock-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.stock-btn.primary { background: #2563EB; color: #fff; border: none; }
.stock-btn.outline { background: #fff; border: 1px solid #2563EB; color: #2563EB; }
.stock-mrp { text-decoration: line-through; color: #94A3B8; font-size: 13px; }
.stock-price-wrap { display: flex; flex-direction: column; }
.discount-badge {
  position: absolute; top: 10px; left: 10px; background: #DC2626; color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px;
}
.stock-warranty { font-size: 12px; color: #64748B; margin: 6px 0; }
.stock-body h3 a { color: inherit; text-decoration: none; }

/* Compact responsive marketplace */
.stock-grid{gap:14px}.stock-card{border-radius:12px}.stock-img-wrap{height:176px;padding:14px}.stock-img-wrap img{width:100%;height:100%;max-height:148px;object-fit:contain}.stock-body{padding:13px}.stock-body h3{font-size:.94rem;line-height:1.3;margin:4px 0}.stock-price{font-size:1.04rem}.stock-btn{min-height:36px;padding:7px 10px;font-size:.72rem}
@media(max-width:768px){.buy-page{width:calc(100% - 24px);margin:16px auto 38px}.buy-content{grid-template-columns:1fr}.buy-filters-panel{position:static;width:100%;max-height:70vh;overflow-y:auto}}
@media(max-width:600px){.stock-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stock-img-wrap{height:138px;padding:9px}.stock-img-wrap img{max-height:118px}.stock-body{padding:10px}.stock-body h3{font-size:.82rem}.stock-desc{font-size:.7rem}.stock-price{font-size:.92rem}.stock-actions{flex-direction:column}.stock-btn{width:100%}}
@media(max-width:350px){.stock-grid{grid-template-columns:1fr}}
