/* ===== SHOP & CART & CHECKOUT ===== */

/* ── Shop Page ── */
.shop-section { padding: 3rem 0 5rem; }

.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.shop-filters {
  display: flex;
  gap: 0.5rem;
}

.shop-filter-btn {
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 100px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-600);
  text-decoration: none;
  transition: all 0.2s;
}

.shop-filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.shop-filter-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

.shop-results-count {
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* ── Product Grid ── */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.shop-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.shop-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.shop-card--oos { opacity: 0.7; }

.shop-card-image {
  display: block;
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--gray-50);
}

.shop-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.shop-card:hover .shop-card-image img {
  transform: scale(1.04);
}

.shop-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--gray-400);
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

.shop-card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shop-card-badge--oos {
  background: var(--gray-700);
  color: var(--white);
}

.shop-card-body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.shop-card-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.shop-card-type, .shop-card-format {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
}

.shop-card-type {
  background: rgba(26, 54, 93, 0.08);
  color: var(--navy);
}

.shop-card-format {
  background: var(--gold-pale);
  color: var(--gold-dark);
}

.shop-card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--navy);
  margin: 0 0 0.3rem;
  line-height: 1.35;
}

.shop-card-title a { color: inherit; text-decoration: none; }
.shop-card-title a:hover { color: var(--gold-dark); }

.shop-card-author {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin: 0 0 0.75rem;
}

.shop-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
}
.shop-card-actions {
  flex-shrink: 0;
}

.shop-price-old {
  text-decoration: line-through;
  color: var(--gray-400);
  font-size: 0.85rem;
  margin-right: 0.35rem;
}

.shop-price-current {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
}

.shop-empty, .cart-empty {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--gray-400);
}

.shop-empty h3, .cart-empty h3 {
  font-family: var(--font-heading);
  color: var(--navy);
  margin: 1rem 0 0.5rem;
}

.shop-empty p, .cart-empty p {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

.shop-pagination {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 3rem;
}

.shop-pagination a, .shop-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  transition: all 0.2s;
}

.shop-pagination a:hover { border-color: var(--navy); color: var(--navy); }
.shop-pagination .current { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ── Cart Page ── */
.cart-section { padding: 3rem 0 5rem; }

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2.5rem;
  align-items: start;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  margin-bottom: 0.75rem;
  transition: all 0.2s;
}

.cart-item:hover { border-color: var(--gray-300); box-shadow: var(--shadow-sm); }

.cart-item-image { width: 72px; height: 72px; border-radius: var(--radius); overflow: hidden; flex-shrink: 0; }
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }

.cart-item-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  color: var(--gray-400);
}

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--navy);
  margin: 0 0 0.2rem;
  line-height: 1.3;
}

.cart-item-title a { color: inherit; text-decoration: none; }
.cart-item-title a:hover { color: var(--gold-dark); }

.cart-item-price {
  font-size: 0.82rem;
  color: var(--gray-500);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.cart-qty-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-300);
  background: var(--white);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}

.cart-qty-minus { border-radius: var(--radius) 0 0 var(--radius); }
.cart-qty-plus { border-radius: 0 var(--radius) var(--radius) 0; }
.cart-qty-btn:hover { background: var(--gray-50); color: var(--navy); }

.cart-qty-input {
  width: 44px;
  height: 32px;
  border: 1px solid var(--gray-300);
  border-left: none;
  border-right: none;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  -moz-appearance: textfield;
}

.cart-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.cart-item-total {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  flex-shrink: 0;
}

.cart-item-remove:hover { color: var(--red); background: #fef2f2; }

/* ── Cart Summary ── */
.cart-summary, .checkout-summary {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: sticky;
  top: 96px;
}

.cart-summary-title, .checkout-heading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--navy);
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-200);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  font-size: 0.92rem;
  color: var(--gray-600);
}

.cart-summary-total {
  border-top: 2px solid var(--gray-200);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

.cart-login-note {
  font-size: 0.88rem;
  color: var(--gray-600);
  text-align: center;
  margin: 1.25rem 0 0;
  line-height: 1.6;
}

.cart-login-note a { color: var(--gold-dark); font-weight: 600; }

.cart-continue-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--gray-500);
  text-decoration: none;
  transition: color 0.2s;
}

.cart-continue-link:hover { color: var(--navy); }

/* ── Checkout ── */
.checkout-section { padding: 3rem 0 5rem; }

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2.5rem;
  align-items: start;
}

.checkout-form-wrap {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.checkout-form textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-family: var(--font-body);
  resize: vertical;
}

.checkout-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 1rem;
}

.checkout-items {
  margin-bottom: 1rem;
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.checkout-item:last-child { border-bottom: none; }

.checkout-item-image { width: 48px; height: 48px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.checkout-item-image img { width: 100%; height: 100%; object-fit: cover; }

.checkout-item-info { flex: 1; min-width: 0; }

.checkout-item-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}

.checkout-item-qty {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.checkout-item-price {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--navy);
  white-space: nowrap;
}

/* ── Orders in My Account ── */
.myacc-orders-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.myacc-order-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: all 0.25s;
}

.myacc-order-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--gray-300);
}

.myacc-order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.myacc-order-id {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--navy);
  font-weight: 700;
}

.myacc-order-items {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.5;
  padding: 0.5rem 0;
}

.myacc-order-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.myacc-order-total {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

.myacc-order-date {
  font-size: 0.78rem;
  color: var(--gray-500);
}

/* ── Static Book Descriptions ── */
.shop-card-desc {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.7;
  margin: 0 0 0.75rem;
}

.shop-card-themes {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}

.shop-card-themes li {
  font-size: 0.8rem;
  color: var(--gray-600);
  line-height: 1.6;
  padding: 0.2rem 0 0.2rem 1.1rem;
  position: relative;
}

.shop-card-themes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.shop-card-note {
  font-size: 0.8rem;
  color: var(--gray-500);
  line-height: 1.6;
  margin: 0 0 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .cart-summary, .checkout-summary { position: static; order: -1; }
}

@media (max-width: 768px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-item { flex-wrap: wrap; }
  .cart-item-total { min-width: auto; }
  .checkout-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .shop-grid { grid-template-columns: 1fr; }
  .shop-filters { flex-wrap: wrap; }
}

/* ===== SINGLE PRODUCT ===== */

.product-detail-section {
  padding: 2rem 0 5rem;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

/* Image */
.product-img-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}

.product-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.product-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-badge--sale {
  background: var(--gold);
  color: #fff;
}

.product-badge--oos {
  background: var(--gray-700);
  color: #fff;
}

.product-img-placeholder {
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  color: var(--gray-400);
}

/* Info */
.product-detail-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.product-detail-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--navy);
  margin: 0 0 0.5rem;
  line-height: 1.25;
}

.product-detail-author {
  font-size: 0.95rem;
  color: var(--gray-500);
  margin: 0 0 1.25rem;
}

.product-detail-price {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.product-price-big {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
}

/* Stock */
.product-stock-info {
  margin-bottom: 1.5rem;
}

.product-stock {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
}

.product-stock--in {
  background: #e6f4ea;
  color: #2d8653;
}

.product-stock--low {
  background: #fef3e0;
  color: #d68d00;
}

.product-stock--out {
  background: #fce8e6;
  color: #c0392b;
}

/* Qty + Add to Cart */
.product-add-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
}

.product-qty-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  overflow: hidden;
}

.product-qty-btn {
  width: 40px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: none;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}

.product-qty-btn:hover {
  background: var(--gray-50);
  color: var(--navy);
}

.product-qty-input {
  width: 52px;
  height: 44px;
  border: none;
  border-left: 1px solid var(--gray-300);
  border-right: 1px solid var(--gray-300);
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  -moz-appearance: textfield;
}

.product-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Details Table */
.product-details-table {
  margin-bottom: 1.5rem;
}

.product-details-heading {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--navy);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.product-details-table table {
  width: 100%;
  border-collapse: collapse;
}

.product-details-table td {
  padding: 0.55rem 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--gray-100);
}

.product-details-table td:first-child {
  color: var(--gray-500);
  font-weight: 600;
  width: 120px;
}

.product-details-table td:last-child {
  color: var(--gray-700);
}

/* Shipping Note */
.product-shipping-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--gray-500);
  padding: 0.65rem 0.85rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

.product-shipping-note svg {
  flex-shrink: 0;
  color: var(--gray-400);
}

/* Description */
.product-description {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--gray-200);
}

.product-desc-heading {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--navy);
  margin: 0 0 1.25rem;
}

.product-desc-body {
  font-size: 0.95rem;
  color: var(--gray-700);
  line-height: 1.8;
  max-width: 760px;
}

.product-desc-body p { margin: 0 0 1rem; }
.product-desc-body ul, .product-desc-body ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.product-desc-body li { margin-bottom: 0.35rem; }

/* Related Products */
.product-related {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--gray-200);
}

.product-related-heading {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--navy);
  margin: 0 0 1.5rem;
}

.shop-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Responsive */
@media (max-width: 1024px) {
  .product-detail-layout { gap: 2rem; }
  .shop-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
  }

  .product-add-row {
    flex-direction: column;
    align-items: stretch;
  }

  .product-add-row .btn { width: 100%; justify-content: center; }

  .shop-grid--3 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .product-price-big { font-size: 1.5rem; }
}
