/* 1. Typeface */
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=Inter:wght@300;400;500&display=swap");

/* 2. Design tokens */
:root {
  --hm-font-heading : "Playfair Display", serif;
  --hm-font-body    : "Inter", sans-serif;
  --hm-text         : #111;
  --hm-grey         : #FFFF;
  --hm-border       : #E6E6E6;
  --hm-shadow       : 0 4px 14px rgba(0, 0, 0, 0.06);
}

/* 3. Layout */
body             { background: var(--hm-grey); }
.products-section{ flex: 1; }

/* Header */
.products-header{
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 30px; font-family: var(--hm-font-body);
  position:sticky;
}
.products-header h2{
  font-size: clamp(1.3rem, 1vw + 1rem, 1.7rem);
  font-weight: 500; letter-spacing: .5px; color: var(--hm-text);
  text-transform: none;
}

.all-products-h1{
    font-size: 2rem;
    height: 15vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Sort */
.sort-options select{
  font-family: var(--hm-font-body); font-size: .9rem;
  padding: 6px 10px; border: 1px solid var(--hm-border); border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e")
             no-repeat right 10px center / 1em; appearance: none;
}

/* 4. Product grid */
.product-grid{
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px;
  background: var(--hm-grey);
  border-radius: 0;
}

/* Card */
.product-card{
  position: relative; 
  background: #fff; 
  border: 1px solid var(--hm-border);
  border-radius: 0px; 
  overflow: hidden;
  cursor: pointer; /* whole card clickable */
  transition: transform .3s ease, box-shadow .3s ease;
}
.product-card:hover{ 
  transform: translateY(-4px); 
  box-shadow: var(--hm-shadow); 
}
.product-card img{
  width: 100%; aspect-ratio: 3/4; object-fit: cover;
  transition: transform .3s ease;
}
.product-card:hover img{ transform: scale(1.02); }

/* Badge */
.product-badge{
  position: absolute; top: 10px; left: 10px;
  padding: 2px 8px; font-size: .65rem; letter-spacing: .4px;
  background: var(--hm-text); color: #fff; border-radius: 2px;
  font-family: var(--hm-font-body); text-transform: uppercase;
}

.product-card .zoom-image,
.product-card .product-title,
.product-card .product-price {
  cursor: pointer;
}

/* ─── Add to Cart Button ─────────────────────────────────── */
.add-to-cart{
  position:absolute; 
  top:12px; right:12px;
  width:34px; height:34px;
  border:none; 
  display:flex; 
  align-items:center; 
  justify-content:center;
  cursor:pointer;
  transform-origin:center;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.6);
  transition: all 0.25s ease;
  z-index: 2; /* stays above card */
}

/* icon style */
.add-to-cart .cart-icon{
  width:18px; height:18px;
  color:#fff;
  transition: transform .2s ease, color .25s ease;
}

/* hover effect */
.add-to-cart:hover{ 
  transform: scale(1.1);
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

/* press effect */
.add-to-cart:active{ transform: scale(.92); }

/* in-cart state: icon turns solid */
.add-to-cart.in-cart .cart-icon{
  color:#fff;
  filter:drop-shadow(0 0 0 #000)
         drop-shadow(0 0 0 #000)
         drop-shadow(0 0 0 #000);
}

/* Premium Luxury Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
    font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.page-btn:hover {
    background: linear-gradient(135deg, #f0f0f0 0%, #f9f9f9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #000;
}

.page-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #f9d423 100%);
    color: #000;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.page-btn.active:hover {
    background: linear-gradient(135deg, #c9a227 0%, #e8c41e 100%);
}

.page-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    transform: none;
    box-shadow: none;
}

.page-btn:not([disabled]):active {
    transform: translateY(1px);
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #888;
    font-size: 14px;
    user-select: none;
}

/* Gold accent line above active page */
.page-btn.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, #d4af37 0%, #f9d423 100%);
    border-radius: 2px;
}

/* Micro-interaction for premium feel */
.page-btn:not([disabled])::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.8) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-btn:not([disabled]):hover::after {
    opacity: 1;
}

.product-price {
  display: flex;
  flex-direction: column; /* stack children vertically */
  align-items: flex-start; /* keep aligned to left */
  gap: 4px; /* space between price and discount */
}

.product-price-old {
  text-decoration: line-through;
  color: #888;
  font-size: 0.9rem;
}

.product-price-new {
  color: #000; /* or your brand color */
  font-weight: 600;
  font-size: 1.1rem;
}

.product-discount {
  background: #D4AF37;
  color: #fff;
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-block; /* no longer forced to same line */
  width: fit-content; /* keep it snug */
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0;
  font-size: 14px;
  color: #f5a623; /* gold for stars */
}
.product-rating .rating-number {
  color: #666;
  font-size: 13px;
}
.product-image img.hover-swap-image {
  transition: opacity 220ms ease-in-out, transform 220ms ease-in-out;
  will-change: opacity;
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* optional: slightly scale on hover for subtle motion (remove if you want flat swap) */
.product-card:hover .product-image img.hover-swap-image {
  transform: scale(1.02);
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .pagination {
        gap: 6px;
    }
    
    .page-btn,
    .pagination-ellipsis {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* Animation for page transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-btn {
    animation: fadeIn 0.3s ease forwards;
}

/* Delay animations for each button */
.page-btn:nth-child(1) { animation-delay: 0.1s; }
.page-btn:nth-child(2) { animation-delay: 0.15s; }
.page-btn:nth-child(3) { animation-delay: 0.2s; }
.page-btn:nth-child(4) { animation-delay: 0.25s; }
.page-btn:nth-child(5) { animation-delay: 0.3s; }
.page-btn:nth-child(6) { animation-delay: 0.35s; }
.page-btn:nth-child(7) { animation-delay: 0.4s; }

/* mobile tweak */
@media(max-width:480px){
  .add-to-cart{ width:28px; height:28px; }
  .add-to-cart .cart-icon{ width:16px; height:16px; }
}

/* Info */
.product-info{ padding: 18px 16px; font-family: var(--hm-font-body); text-align: left; }
.product-info h3{ font-size: 1rem; font-weight: 500; margin: 0 0 .4rem; color: var(--hm-text); }
.price{ font-size: .9rem; font-weight: 500; color: var(--hm-text); margin: 0; }

/* Pagination */
.pagination{ display: flex; justify-content: center; gap: 12px; margin-top: 50px; font-family: var(--hm-font-body); }
.pagination a{
  padding: 8px 15px; border: 1px solid var(--hm-border); border-radius: 4px;
  font-size: .9rem; color: var(--hm-text); text-decoration: none;
}
.pagination a.active{ background: #000; color: #fff; border-color: #000; }

/* 5. Responsive */
@media (max-width: 1024px){ .product-grid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px ){
  .product-grid{ gap: 24px; }
  .products-header h2{ font-size: 1.4rem; }
}
@media (max-width: 480px ){
  .product-grid{ grid-template-columns: repeat(2,1fr); gap: 16px; }
  .product-card img{ aspect-ratio: 4/5; }
  .product-info{ padding: 12px; }
  .product-info h3{ font-size: .9rem; }
  .price{ font-size: .85rem; }
}

/* Mobile header adjustment */
@media (max-width:900px){
  .filter-actions{
    flex-wrap: wrap;
    gap: 12px;
  }
  .apply-btn,
  .reset-btn{
    flex: 1 1 0;
    min-width: 0;
  }
  .all-products-h1{
    font-size: 2rem;
    height: 20vh;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .product-grid{ grid-template-columns: repeat(2,1fr); gap: 0.2em; }
  .product-card{ height: auto; width: 100%; }
}

@media (min-width: 992px){        
  .product-grid{
    grid-template-columns:repeat(4, 1fr);
    gap: 0.5em;
  }
}

/* ──────────────────────────────────────────────────────────────
   Elite / Minimal style for Featured <select> + Filters button
   on screens ≤ 768 px
   ──────────────────────────────────────────────────────────────*/
@media (max-width:768px){
   .products-section{
    padding-left: 0;
    padding-right: 0;
  }
  
   .products-header{
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    padding: 8px 0;
    box-shadow: none;
  }

  .filter-toggle {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
  }

  .filter-sidebar-mobile-btn, .sort-options{
    display: flex;
    width: 80%;
  }

  .sort-options select, .filter-toggle{
    height:40px;
    padding:0 16px 0 14px;
    border:1px solid #d0d0d0;
    border-radius:4px;
    background:#fff;
    color:#111;
    font:500 .9rem/1 var(--hm-font-body, "Inter", sans-serif);
    box-sizing:border-box;
    transition: box-shadow .25s ease, background .25s ease, transform .18s ease;
  }

  .sort-options select,
  .sort-options .filter-toggle{
    flex: 1 1 0;
    width: 100%;
  }

  .sort-options select{
    -webkit-appearance:none;
    -moz-appearance:none;
    appearance:none;
    background-image:
      url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' stroke='%23111' stroke-width='2' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 12px center;
    background-size:12px;
  }

  .sort-options select:hover,
  .filter-toggle:hover{
    box-shadow:0 2px 8px rgba(0,0,0,.08);
  }
  .filter-toggle:active{
    transform:scale(.96);
  }
  .sort-options select:focus{
    outline:none;
    box-shadow:0 0 0 2px rgba(0,0,0,.12);
  }
}
