/* Shared shop styles - Crypvilla */
:root {
  --crypvilla-primary: #0077ff;
  --crypvilla-primary-dark: #0056b3;
  --crypvilla-text: #0f172a;
  --crypvilla-text-muted: #475569;
  --crypvilla-bg: #ffffff;
  --crypvilla-bg-soft: #f8fafc;
  --crypvilla-border: #e2e8f0;
  --crypvilla-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --crypvilla-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--crypvilla-bg); color: var(--crypvilla-text); }

.top-bar {
  background: linear-gradient(90deg, var(--crypvilla-primary), var(--crypvilla-primary-dark));
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  padding: 0.5rem 1rem;
}

.navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--crypvilla-border);
  padding: 0.75rem 0;
}
.navbar-brand { font-weight: 700; color: var(--crypvilla-text) !important; display: flex; align-items: center; }
.navbar-brand img { height: 100px; width: auto; }
.nav-link {
  color: var(--crypvilla-text-muted) !important;
  font-weight: 500;
  padding: 0.5rem 0.75rem !important;
  border-radius: 8px;
}
.nav-link:hover { color: var(--crypvilla-primary) !important; }
.btn-shop {
  background: linear-gradient(135deg, var(--crypvilla-primary), var(--crypvilla-primary-dark));
  color: #fff !important;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 10px;
  border: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn-shop:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0, 119, 255, 0.3); color: #fff !important; }

.card-product {
  background: var(--crypvilla-bg);
  border: 1px solid var(--crypvilla-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--crypvilla-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-product:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 119, 255, 0.2);
  box-shadow: var(--crypvilla-shadow-lg);
}
.card-product .img-wrap {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--crypvilla-bg-soft);
  position: relative;
}
.card-product .img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.card-product:hover .img-wrap img { transform: scale(1.06); }
.card-product .card-body { padding: 1.25rem; }
.card-product .card-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; color: var(--crypvilla-text); }
.card-product .text-muted { color: var(--crypvilla-text-muted) !important; font-size: 0.9rem; }

.badge-sale {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: #dc3545;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  z-index: 1;
}

.badge-out-of-stock {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: #6c757d;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  z-index: 1;
}

.card-out-of-stock .img-wrap img { opacity: 0.85; }
.card-out-of-stock .card-body .text-muted { opacity: 0.9; }

.spec-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.spec-pill {
  font-size: 0.75rem;
  color: var(--crypvilla-text-muted);
  background: var(--crypvilla-bg-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.price-current { font-weight: 700; color: var(--crypvilla-text); }
.price-compare { font-size: 0.875rem; color: var(--crypvilla-text-muted); text-decoration: line-through; margin-left: 0.5rem; }

.footer {
  border-top: 1px solid var(--crypvilla-border);
  padding: 3rem 0 2rem;
  background: var(--crypvilla-bg);
  color: var(--crypvilla-text-muted);
  font-size: 0.9rem;
  margin-top: auto;
}
.footer a { color: var(--crypvilla-text-muted); text-decoration: none; }
.footer a:hover { color: var(--crypvilla-primary); }
.footer strong.text-dark { color: var(--crypvilla-text) !important; }

.cart-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--crypvilla-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner { color: var(--crypvilla-primary); }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--crypvilla-text-muted); }

/* ========== Shop hero carousel (Shopinverse-style) ========== */
.shop-hero {
  overflow: hidden;
  position: relative;
}
#shopCarousel {
  position: relative;
}
.shop-carousel-slide {
  height: 280px;
  background-size: cover;
  background-position: center;
  position: relative;
}
@media (min-width: 768px) {
  .shop-carousel-slide { height: 380px; }
}
@media (min-width: 992px) {
  .shop-carousel-slide { height: 460px; }
}
.shop-carousel-1 { background-image: url('https://images.unsplash.com/photo-1496181133206-80ce9b88a853?w=1600&q=82'); }
.shop-carousel-2 { background-image: url('https://images.unsplash.com/photo-1517336714731-489689fd1ca8?w=1600&q=82'); }
.shop-carousel-3 { background-image: url('https://images.unsplash.com/photo-1531297484001-80022131f5a1?w=1600&q=82'); }
.carousel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 55, 255, 0.78) 0%, rgba(0, 86, 179, 0.65) 100%);
  z-index: 1;
}
.carousel-caption-shop {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1rem 2rem;
  color: #fff;
  text-align: left;
  z-index: 2;
}
@media (min-width: 992px) {
  .carousel-caption-shop {
    text-align: center;
    padding: 2rem 2rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
  }
  .carousel-caption-shop h2 { max-width: 640px; }
  .carousel-caption-shop p { max-width: 520px; }
}
.carousel-caption-shop h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.carousel-caption-shop p {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  opacity: 0.95;
}
.carousel-caption-shop .btn-shop {
  background: #fff;
  color: var(--crypvilla-primary) !important;
  border: none;
}
.carousel-caption-shop .btn-shop:hover {
  background: var(--crypvilla-bg-soft);
  color: var(--crypvilla-primary-dark) !important;
}
/* Carousel controls - above overlay, clickable */
.shop-carousel-control {
  z-index: 20 !important;
  width: 48px !important;
  opacity: 1 !important;
  background: transparent !important;
  border: none !important;
}
.shop-carousel-control:hover { opacity: 0.9 !important; }
#shopCarousel .shop-carousel-control .carousel-control-prev-icon,
#shopCarousel .shop-carousel-control .carousel-control-next-icon {
  filter: none;
  background-color: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
  background-size: 55%;
  padding: 0;
}
#shopCarousel .carousel-indicators {
  z-index: 15;
}
#shopCarousel .carousel-indicators button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.6);
}
#shopCarousel .carousel-indicators button.active { background-color: #fff; }

/* ========== Section headings ========== */
.shop-section { scroll-margin-top: 5rem; }
.section-head {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--crypvilla-text);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--crypvilla-primary);
  display: inline-block;
  letter-spacing: -0.01em;
}

/* ========== Shop breadcrumb ========== */
.shop-breadcrumb { margin-bottom: 0.75rem; }
.breadcrumb-shop { font-size: 0.875rem; }
.breadcrumb-shop .breadcrumb-item a { color: var(--crypvilla-text-muted); text-decoration: none; }
.breadcrumb-shop .breadcrumb-item a:hover { color: var(--crypvilla-primary); }
.breadcrumb-shop .breadcrumb-item.active { color: var(--crypvilla-text); }
.breadcrumb-shop .breadcrumb-item + .breadcrumb-item::before { content: '›'; opacity: 0.6; }

/* ========== Category bar (switch categories) ========== */
.shop-category-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--crypvilla-border);
}
.shop-category-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--crypvilla-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.shop-category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.shop-cat-pill {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--crypvilla-text-muted);
  background: var(--crypvilla-bg-soft);
  border: 1px solid var(--crypvilla-border);
  border-radius: 999px;
  text-decoration: none;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.shop-cat-pill:hover {
  color: var(--crypvilla-primary);
  background: #fff;
  border-color: var(--crypvilla-primary);
}
.shop-cat-pill.active {
  color: #fff;
  background: linear-gradient(135deg, var(--crypvilla-primary), var(--crypvilla-primary-dark));
  border-color: transparent;
}
.shop-category-select { max-width: 200px; }
@media (max-width: 767px) {
  .shop-category-select { max-width: none; width: 100%; }
  .shop-category-bar { flex-direction: column; align-items: stretch; }
}

/* ========== Toolbar (count + sort) ========== */
.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 0.5rem;
}
.shop-toolbar-count {
  font-size: 0.875rem;
  color: var(--crypvilla-text-muted);
  margin: 0;
}
.shop-toolbar-sort { display: flex; align-items: center; gap: 0.5rem; }
.shop-sort-label { font-size: 0.875rem; color: var(--crypvilla-text-muted); margin: 0; white-space: nowrap; }
.shop-sort { width: auto; min-width: 170px; }

/* ========== Pagination ========== */
.shop-pagination { padding: 1.5rem 0 0.5rem; }
.pagination-shop .page-link {
  padding: 0.5rem 1rem;
  color: var(--crypvilla-text);
  border-color: var(--crypvilla-border);
  border-radius: 8px;
  margin: 0 0.2rem;
}
.pagination-shop .page-link:hover { background: var(--crypvilla-bg-soft); color: var(--crypvilla-primary); border-color: var(--crypvilla-border); }
.pagination-shop .page-item.disabled .page-link { pointer-events: none; opacity: 0.6; }
.pagination-shop .page-info { font-size: 0.875rem; color: var(--crypvilla-text-muted); }

/* ========== Category cards (shop landing) ========== */
.category-card-link { text-decoration: none; color: inherit; display: block; }
.category-card {
  border: 1px solid var(--crypvilla-border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 119, 255, 0.3);
  box-shadow: var(--crypvilla-shadow-lg);
}
.category-card-img {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--crypvilla-bg-soft);
}
.category-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.category-card:hover .category-card-img img { transform: scale(1.08); }
.category-card .card-title { font-size: 0.95rem; font-weight: 600; color: var(--crypvilla-text); }

/* Cart: visible on mobile next to hamburger, hidden in menu; desktop opposite */
.nav-cart-mobile { display: none; }
@media (max-width: 991px) {
  .nav-cart-mobile {
    display: inline-flex;
    align-items: center;
    position: relative;
    margin-right: 0.25rem;
    padding: 0.35rem 0.65rem;
    padding-right: 1.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  .nav-cart-mobile .cart-count-badge {
    font-size: 0.65rem;
    min-width: 1rem;
    height: 1rem;
    top: -4px;
    right: 4px;
    z-index: 1;
  }
  .nav-cart-desktop { display: none !important; }
}

/* ========== Mobile responsive ========== */
@media (max-width: 991px) {
  .navbar-brand img { height: 60px; }
  .top-bar { font-size: 0.8rem; padding: 0.4rem 0.75rem; }
  main.container { padding-left: 1rem; padding-right: 1rem; }
  .footer { padding: 2rem 0 1.5rem; }
  .footer .row { text-align: center; }
  .footer .col-md-2 ul { padding-left: 0; }
  .shop-carousel-slide { height: 260px; }
  .carousel-caption-shop h2 { font-size: 1.4rem; }
  .carousel-caption-shop p { font-size: 0.9rem; }
  .section-head { font-size: 1.35rem; }
}

@media (max-width: 768px) {
  .navbar-brand img { height: 48px; }
  .top-bar { font-size: 0.75rem; padding: 0.35rem 0.5rem; }
  .section-title { font-size: 1.5rem; }
  .card-product .card-body { padding: 1rem; }
  .card-product .card-title { font-size: 1rem; }
  .empty-state { padding: 2rem 0.75rem; }
  .shop-carousel-slide { height: 220px; }
  .carousel-caption-shop { padding: 1.25rem 1rem 1.5rem; }
  .carousel-caption-shop h2 { font-size: 1.2rem; }
  .carousel-caption-shop p { font-size: 0.85rem; margin-bottom: 0.75rem; }
  .carousel-caption-shop .btn-lg { font-size: 0.9rem; padding: 0.4rem 0.9rem; }
  .category-card .card-title { font-size: 0.875rem; }
  /* Shop: smaller buttons on product cards and category filter */
  .card-product .btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
  .category-link { padding: 0.25rem 0.5rem !important; font-size: 0.8rem !important; }
  /* Cart: summary above list on small screens for better flow */
  #cartContent .col-lg-4 { order: -1; margin-bottom: 1rem; }
  #cartContent .col-lg-8 { order: 1; }
  /* Cart item rows: stack image and details on very small screens */
  .list-group-item.d-flex { flex-wrap: wrap; }
  .list-group-item .flex-grow-1 { min-width: 100%; }
}

@media (max-width: 576px) {
  .navbar-brand img { height: 42px; }
  main.container { padding-left: 0.75rem; padding-right: 0.75rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
  .section-title { font-size: 1.35rem; }
  /* Product detail: stack action buttons full width */
  .product-actions { flex-direction: column; }
  .product-actions .btn,
  .product-actions a.btn { width: 100%; margin: 0 !important; }
  /* Offer status bar alerts */
  #offerStatusBar .alert .d-flex.flex-wrap { flex-direction: column; align-items: stretch; }
  #offerStatusBar .alert .btn { margin-left: 0 !important; margin-top: 0.5rem; }
  #offerCheckStatusWrap .d-flex.flex-wrap { flex-direction: column; }
  #offerCheckStatusWrap input { max-width: none !important; }
  /* Checkout: form and summary full width */
  #checkoutFormWrap .card { padding: 1rem !important; }
  .footer .col-md-4, .footer .col-md-2 { margin-bottom: 1rem; }
  /* Modals: full width with safe margins */
  .modal-dialog { margin: 0.5rem; max-width: calc(100% - 1rem); }
  .modal-body { padding: 1rem; }
  /* Breadcrumb: allow wrap */
  .breadcrumb { font-size: 0.9rem; }
}

/* Shop: compact buttons on small mobile */
@media (max-width: 576px) {
  .d-flex.flex-wrap.gap-2.align-items-center .category-link { font-size: 0.75rem; padding: 0.2rem 0.4rem; }
  .card-product .mt-2.d-flex.gap-1 .btn { padding: 0.2rem 0.4rem; font-size: 0.7rem; }
  .nav-cart-mobile { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
}
