/* ===============================
   SHOP PAGE — PROFESSIONAL ENHANCED
   File: /assets/frontend/css/pages-shop.css
   Features: Real-time views, Dynamic stock, Clean professional design
================================ */

/* Page wrapper */
.hp-shop{
  padding: 18px 0 40px;
}
.shop-wrap{
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 14px;
}

/* ===============================
   HERO / TOP BAR
================================ */
.shop-hero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  padding: 18px 0 14px;
  border-bottom:1px solid rgba(17,17,17,.08);
  flex-wrap:wrap;
}

.shop-hero__left{
  min-width: 240px;
}
.shop-hero__right{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.crumbs{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:rgba(17,17,17,.58);
  letter-spacing:.08em;
  text-transform:uppercase;
}
.crumbs a{
  color:rgba(17,17,17,.62);
  text-decoration:none;
}
.crumbs a:hover{ text-decoration:underline; }

.shop-title{
  margin: 10px 0 6px;
  font-size: 48px;
  line-height:1;
  letter-spacing:.06em;
  font-weight: 900;
}
.shop-sub{
  font-size:13px;
  color:rgba(17,17,17,.62);
}

/* Search + Sort */
.shop-search{
  display:flex;
  align-items:center;
  gap:10px;
  background:#fff;
  border:1px solid rgba(17,17,17,.12);
  border-radius:999px;
  padding:8px 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.04);
}
.shop-search input{
  border:0;
  outline:none;
  background:transparent;
  padding:10px 12px;
  min-width: 260px;
  font-size:13px;
}
.shop-search .btn,
.shop-search button{
  border:1px solid rgba(17,17,17,.14);
  background: linear-gradient(135deg, rgba(199,162,83,.24), rgba(199,162,83,.10));
  border-radius:999px;
  padding:10px 14px;
  font-weight:900;
  letter-spacing:.10em;
  text-transform:uppercase;
  font-size:11px;
  cursor:pointer;
  transition:.2s ease;
}
.shop-search .btn:hover,
.shop-search button:hover{
  transform: translateY(-1px);
  border-color: rgba(17,17,17,.26);
}

/* Sort dropdown */
.shop-sort{
  border:1px solid rgba(17,17,17,.12);
  background:#fff;
  border-radius:999px;
  padding:10px 12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:11px;
  cursor:pointer;
  outline:none;
}

/* ===============================
   CATEGORY PILLS
================================ */
.shop-cats{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  padding: 14px 0 10px;
}

.shop-cats .catpill{
  border:1px solid rgba(17,17,17,.14);
  background:#fff;
  border-radius:999px;
  padding:10px 14px;
  letter-spacing:.18em;
  text-transform:uppercase;
  font-size:11px;
  font-weight:900;
  cursor:pointer;
  transition:.2s ease;
}
.shop-cats .catpill:hover{
  transform: translateY(-1px);
  border-color: rgba(17,17,17,.26);
}
.shop-cats .catpill.is-active{
  background:#111;
  color:#fff;
  border-color:#111;
}

/* ===============================
   ✅ GRID (FIXED)
   Desktop: 4 per row
   Tablet: 3 per row
   Mobile: 2 per row (ALWAYS)
================================ */
.shop-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:14px;
  padding-top: 12px;
}

/* Desktop -> Tablet */
@media(max-width:1100px){
  .shop-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Tablet -> Mobile */
@media(max-width:820px){
  .shop-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  gap: 10px;
}

/* Mobile stays 2 columns */
@media(max-width:520px){
  .shop-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  gap: 8px;
}

/* ===============================
   PROFESSIONAL PRODUCT CARD
================================ */

/* Card Container */
.sp-card{
  border: 1px solid #000 !important; /* Changed to black */
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,.02);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sp-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,.06);
  border-color: #000 !important; /* Changed to black on hover */
}

/* Badge Container - Positioned on Image */
.sp-badge-container{
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Sale Tag */
.sp-sale-tag{
  background: linear-gradient(135deg, #e44d4d, #c0392b);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(192,57,43,.2);
  display: inline-block;
  width: fit-content;
}

/* Discount Badge */
.sp-badge{
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  width: fit-content;
}

/* New Badge */
.sp-badge-new{
  background: #2c3e50;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  width: fit-content;
}

/* Product Image Container */
.sp-img{
  display: block;
  background: #f8f9fa;
  height: 280px; /* Increased from 220px */
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(17,17,17,.04);
}

.sp-img img{
  width: 100%;
  height: 100%;
  object-fit: cover; /* Changed to cover */
  padding: 0; /* Removed padding */
  transition: transform 0.3s ease;
}

.sp-card:hover .sp-img img{
  transform: scale(1.05);
}

/* Product Body */
.sp-body{
  padding: 14px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  background: #fff;
}

/* Product Name */
.sp-name{
  display: block;
  text-decoration: none;
  color: #111;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-size: 12px;
  line-height: 1.4;
  min-height: 34px;
  transition: color 0.2s;
  margin-bottom: 2px;
}

.sp-name:hover{
  color: #c7a253;
}

/* Product Meta Row - Rating + Views */
.sp-meta-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0;
}

/* Rating Section */
.sp-rating{
  display: flex;
  align-items: center;
  gap: 4px;
}

.stars{
  display: flex;
  gap: 2px;
  color: #f39c12;
  font-size: 10px;
}

.rating-count{
  color: #7f8c8d;
  font-size: 11px;
  font-weight: 500;
}

/* Views Counter - Real-time */
.sp-views{
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #7f8c8d;
  background: #f8f9fa;
  padding: 3px 8px;
  border-radius: 30px;
}

.sp-views i{
  font-size: 11px;
  color: #95a5a6;
}

.sp-views.live{
  position: relative;
}

.sp-views.live::after{
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 6px;
  height: 6px;
  background: #2ecc71;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot{
  0%{ transform: scale(1); opacity: 1; }
  50%{ transform: scale(1.2); opacity: 0.7; }
  100%{ transform: scale(1); opacity: 1; }
}

/* Price Section */
.sp-price{
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0;
  padding: 4px 0;
  border-top: 1px dashed rgba(17,17,17,.06);
  border-bottom: 1px dashed rgba(17,17,17,.06);
}

.sp-now{
  font-weight: 800;
  font-size: 15px;
  color: #111;
}

.sp-now::before{
  content: 'PKR';
  font-weight: 500;
  font-size: 10px;
  margin-right: 3px;
  color: #7f8c8d;
}

.sp-old{
  font-size: 12px;
  color: #95a5a6;
  text-decoration: line-through;
}

.sp-old::before{
  content: 'PKR';
  font-weight: 400;
  font-size: 9px;
  margin-right: 2px;
}

/* Dynamic Stock Status */
.sp-stock-container{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0;
}

.sp-stock{
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

.sp-stock.in-stock{
  background: rgba(46, 204, 113, 0.1);
  color: #27ae60;
}

.sp-stock.low-stock{
  background: rgba(241, 196, 15, 0.1);
  color: #f39c12;
}

.sp-stock.out-of-stock{
  background: rgba(231, 76, 60, 0.1);
  color: #c0392b;
}

/* Stock Alert for Low Stock */
.sp-stock-alert{
  font-size: 10px;
  color: #e67e22;
  background: rgba(230, 126, 34, 0.1);
  padding: 3px 8px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sp-stock-alert i{
  font-size: 10px;
}

/* Action Buttons */
.sp-actions{
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 10px;
}

.sp-cta,
.sp-buy{
  border-radius: 6px;
  padding: 10px 8px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  border: none;
  text-align: center;
}

.sp-cta{
  background: #fff;
  border: 1.5px solid #111;
  color: #111;
  position: relative;
  overflow: hidden;
}

.sp-cta:hover{
  background: #111;
  color: #fff;
}

.sp-buy{
  background: #111;
  color: #fff;
  border: 1.5px solid #111;
}

.sp-buy:hover{
  background: #c7a253;
  border-color: #c7a253;
}

/* Empty state */
.hp-empty{
  grid-column: 1 / -1;
  padding: 40px;
  border: 1px solid rgba(17,17,17,.08);
  border-radius: 16px;
  color: #7f8c8d;
  background: #fff;
  text-align: center;
  font-size: 14px;
}

/* Load more button */
.shop-more-wrap{
  display: flex;
  justify-content: center;
  padding: 30px 0 0;
}

.shop-more-wrap .btn,
.shop-more-wrap button{
  border: 1.5px solid #111;
  background: transparent;
  border-radius: 6px;
  padding: 12px 32px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: #111;
}

.shop-more-wrap button:hover{
  background: #111;
  color: #fff;
}

/* ===============================
   MOBILE TUNING
================================ */
@media(max-width:600px){
  .shop-title{ font-size:36px; }

  .shop-hero__right{ width:100%; }
  .shop-search{ width:100%; justify-content:space-between; }
  .shop-search input{ min-width: 0; width:100%; }
  .shop-sort{ width:100%; }

  .sp-img{ height: 200px; } /* Adjusted for mobile */
  
  .sp-body{ padding: 10px 8px 12px; }
  .sp-name{ font-size: 11px; min-height: 30px; }
  .sp-now{ font-size: 13px; }
  .sp-old{ font-size: 11px; }
  
  .sp-views{ font-size: 9px; padding: 2px 6px; }
  .stars{ font-size: 9px; }
  
  .sp-cta, .sp-buy{
    padding: 8px 4px;
    font-size: 9px;
  }
  
  .sp-stock{
    font-size: 10px;
    padding: 3px 8px;
  }
}

/* ===============================
   SHOP EXTRAS (Promo / Sticky / Newsletter / Popup)
================================ */

/* Promo top */
.shop-promo-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  margin: 6px 0 16px;
  border:1px solid rgba(17,17,17,.06);
  border-radius:12px;
  background: linear-gradient(135deg, rgba(17,17,17,.02), rgba(199,162,83,.06));
}
.promo-badge{
  border:1px solid rgba(17,17,17,.1);
  background:#111;
  color:#fff;
  border-radius:6px;
  padding:6px 12px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:11px;
  white-space:nowrap;
}
.promo-text{
  flex:1;
  font-size:13px;
  color:#111;
  line-height:1.5;
}
.promo-sub{
  display:block;
  margin-top:4px;
  color:rgba(17,17,17,.55);
  font-size:12px;
}
.promo-cta{
  border:1px solid rgba(17,17,17,.1);
  background:#fff;
  border-radius:6px;
  padding:8px 16px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:11px;
  text-decoration:none;
  color:#111;
  transition:.2s ease;
  white-space:nowrap;
}
.promo-cta:hover{
  background:#111;
  color:#fff;
}

/* Sticky categories */
.shop-sticky{
  position:sticky;
  top: 64px;
  z-index:20;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  padding: 10px 0 8px;
  border-bottom: 1px solid rgba(17,17,17,.06);
}

/* Newsletter */
.shop-newsletter{
  margin-top: 30px;
  border:1px solid rgba(17,17,17,.06);
  border-radius:16px;
  background: #f8f9fa;
  padding: 20px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.shop-newsletter h3{
  margin:0;
  font-size:18px;
  font-weight:700;
  letter-spacing:.04em;
}
.shop-newsletter p{
  margin:6px 0 0;
  font-size:13px;
  color:#7f8c8d;
}
.nl-right{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.nl-right input{
  border:1px solid rgba(17,17,17,.1);
  border-radius:6px;
  padding:10px 16px;
  min-width: 260px;
  outline:none;
  font-size:13px;
}
.nl-right input:focus{
  border-color: #c7a253;
}
.nl-right button{
  border:1px solid rgba(17,17,17,.1);
  background:#111;
  color:#fff;
  border-radius:6px;
  padding:10px 20px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:11px;
  cursor:pointer;
  transition:.2s ease;
}
.nl-right button:hover{
  background:#c7a253;
}

/* Popup modal */
.shop-pop{
  position:fixed;
  inset:0;
  display:none;
  z-index:9999;
}
.shop-pop.is-open{display:block;}
.shop-pop__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.6);
}
.shop-pop__card{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%,-50%);
  width:min(480px, 90vw);
  background:#fff;
  border-radius:16px;
  border:1px solid rgba(17,17,17,.08);
  box-shadow: 0 20px 40px rgba(0,0,0,.15);
  padding: 24px;
  animation: popIn .2s ease;
}
@keyframes popIn{
  from{
    opacity:0;
    transform:translate(-50%,-45%);
  }
  to{
    opacity:1;
    transform:translate(-50%,-50%);
  }
}
.shop-pop__x{
  position:absolute;
  right:16px;
  top:16px;
  width:32px;height:32px;
  border-radius:6px;
  border:1px solid rgba(17,17,17,.08);
  background:#fff;
  cursor:pointer;
  font-size:18px;
  transition:.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-pop__x:hover{
  background:#111;
  color:#fff;
}
.shop-pop__badge{
  display:inline-block;
  background:#111;
  color:#fff;
  border-radius:6px;
  padding:6px 12px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:11px;
}
.shop-pop__actions{
  margin-top:20px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.shop-pop__btn{
  flex:1;
  text-align:center;
  border-radius:6px;
  padding:12px 16px;
  background:#111;
  color:#fff;
  text-decoration:none;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:11px;
  transition:.2s ease;
}
.shop-pop__btn:hover{
  background:#c7a253;
}
.shop-pop__ghost{
  flex:1;
  border-radius:6px;
  padding:12px 16px;
  border:1px solid rgba(17,17,17,.1);
  background:#fff;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:11px;
  cursor:pointer;
}
.shop-pop__ghost:hover{
  background:#f8f9fa;
}
.shop-pop__check{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top:16px;
  font-size:12px;
  color:#7f8c8d;
}

/* Responsive tuning */
@media(max-width:700px){
  .shop-promo-top{flex-direction:column;align-items:flex-start}
  .promo-cta{width:100%;text-align:center}
  .shop-sticky{top: 56px;}
  .nl-right input{min-width: 180px; width:100%;}
  .nl-right{width:100%}
  .nl-right button{width:100%}
}

/* Toast Notifications */
.toast-container{
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast{
  background: #111;
  color: #fff;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 20px rgba(0,0,0,.1);
  animation: slideIn 0.2s ease;
}

@keyframes slideIn{
  from{
    transform: translateX(100%);
    opacity: 0;
  }
  to{
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===============================
   SIZE BUTTONS FOR SHOP CARDS
   Added for dynamic size selection
================================ */
.sp-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0 8px;
    border-top: 1px solid rgba(0,0,0,0.05);
    margin-top: 8px;
}

.sp-size-btn {
    min-width: 44px;
    height: 36px;
    padding: 0 10px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.sp-size-btn:hover {
    background: #000;
    color: white;
    border-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.sp-size-btn:active {
    transform: translateY(0);
}

.sp-size-btn.in-stock {
    border-color: #4CAF50;
    color: #2E7D32;
    background: #F1F8E9;
}

.sp-size-btn.in-stock:hover {
    background: #2E7D32;
    color: white;
    border-color: #2E7D32;
}

.sp-size-btn.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    border-color: #ddd;
    color: #999;
    text-decoration: line-through;
}

.sp-sizes.out-of-stock {
    color: #999;
    font-size: 12px;
    font-weight: 400;
    padding: 12px 0;
    text-align: center;
    font-style: italic;
}

/* Selected size indicator */
.sp-size-btn.active {
    background: #000;
    color: white;
    border-color: #000;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ===============================
   ACTION BUTTONS FOR SHOP CARDS
   ADD TO CART & BUY NOW - Professional Styling
================================ */
.sp-actions-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.sp-add-btn,
.sp-buy-btn {
    flex: 1;
    padding: 12px 8px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sp-add-btn {
    background: #fff;
    color: #000;
    border: 1.5px solid #000;
}

.sp-add-btn:hover:not(:disabled) {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.sp-buy-btn {
    background: #000;
    color: #fff;
    border: 1.5px solid #000;
}

.sp-buy-btn:hover:not(:disabled) {
    background: #c7a253;
    border-color: #c7a253;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(199,162,83,0.2);
}

.sp-add-btn:disabled,
.sp-buy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile responsive for action buttons */
@media (max-width: 600px) {
    .sp-actions-buttons {
        gap: 6px;
    }
    
    .sp-add-btn,
    .sp-buy-btn {
        padding: 10px 4px;
        font-size: 10px;
    }
}

/* Mobile responsive for size buttons */
@media (max-width: 600px) {
    .sp-size-btn {
        min-width: 38px;
        height: 32px;
        font-size: 11px;
        padding: 0 6px;
    }
    
    .sp-sizes {
        gap: 6px;
        padding: 10px 0 6px;
    }
}
/* ===============================
   COLOR DOTS STYLES
================================ */
.sp-colors {
    display: flex;
    gap: 6px;
    margin: 6px 0;
    flex-wrap: wrap;
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.color-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .color-dot {
        width: 16px;
        height: 16px;
    }
}
/* ===============================
   FIXED BUTTON ALIGNMENT & CARD SIZING
================================ */

/* Fix card height consistency */
.sp-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 580px; /* Consistent minimum height */
}

/* Make product body flexible */
.sp-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 12px 16px;
}

/* Push buttons to bottom */
.sp-actions-buttons {
    margin-top: auto !important;
    padding-top: 12px;
    display: flex;
    gap: 10px;
    width: 100%;
}

/* Equal button sizes */
.sp-add-btn,
.sp-buy-btn {
    flex: 1 1 0; /* Equal width */
    min-width: 0; /* Prevent overflow */
    padding: 12px 8px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Smaller card height */
.sp-img {
    height: 240px !important; /* Reduced from 280px */
}

/* Color dots styling */
.sp-colors {
    display: flex;
    gap: 8px;
    margin: 8px 0;
    flex-wrap: wrap;
    min-height: 28px;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    display: inline-block;
}

.color-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* No colors message */
.sp-colors .no-colors {
    font-size: 11px;
    color: #999;
    font-style: italic;
}

/* Stock container fix */
.sp-stock-container {
    margin-top: 12px !important;
    min-height: 32px;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .sp-card {
        min-height: 520px;
    }
    
    .sp-img {
        height: 200px !important;
    }
    
    .color-dot {
        width: 20px;
        height: 20px;
    }
    
    .sp-add-btn,
    .sp-buy-btn {
        padding: 10px 4px;
        font-size: 10px;
    }
}
/* ===============================
   SIZE ALERT POPUP STYLES
================================ */
.size-alert-popup {
    position: absolute !important;
    top: -30px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background-color: #000 !important;
    color: #fff !important;
    padding: 8px 16px !important;
    border-radius: 30px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    z-index: 1000 !important;
    animation: fadeInOut 0.2s ease forwards !important;
    pointer-events: none !important;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* Ensure cards have position relative */
.sp-card {
    position: relative !important;
}
/* ===============================
   SIZE SELECTION POPUP STYLES
================================ */
.size-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.size-popup-overlay.active {
    display: flex;
    opacity: 1;
}

.size-popup {
    background: white;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.size-popup-overlay.active .size-popup {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.popup-close:hover {
    background: #000;
    color: white;
    transform: rotate(90deg);
}

.popup-product {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.popup-product-image {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    flex-shrink: 0;
}

.popup-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-product-info {
    flex: 1;
}

.popup-product-name {
    font-weight: 700;
    font-size: 18px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.popup-product-price {
    font-size: 20px;
    font-weight: 800;
    color: #c7a253;
}

.popup-product-price .old {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: 400;
}

.popup-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.popup-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.popup-size-btn {
    min-width: 70px;
    height: 50px;
    padding: 0 10px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.popup-size-btn.in-stock:hover {
    border-color: #c7a253;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.popup-size-btn.active {
    border-color: #c7a253;
    background: #c7a253;
    color: white;
}

.popup-size-btn.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    text-decoration: line-through;
}

.size-stock-badge {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.popup-size-btn.active .size-stock-badge {
    color: rgba(255,255,255,0.8);
}

.popup-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.popup-add-to-cart,
.popup-buy-now {
    flex: 1;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
}

.popup-add-to-cart {
    background: white;
    color: #000;
    border: 2px solid #000;
}

.popup-add-to-cart:hover:not(:disabled) {
    background: #000;
    color: white;
    transform: translateY(-2px);
}

.popup-buy-now {
    background: #000;
    color: white;
    border: 2px solid #000;
}

.popup-buy-now:hover:not(:disabled) {
    background: #c7a253;
    border-color: #c7a253;
    transform: translateY(-2px);
}

.popup-add-to-cart:disabled,
.popup-buy-now:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .size-popup {
        padding: 20px;
    }
    
    .popup-product {
        gap: 15px;
    }
    
    .popup-product-image {
        width: 80px;
        height: 80px;
    }
    
    .popup-product-name {
        font-size: 16px;
    }
    
    .popup-size-btn {
        min-width: 60px;
        height: 45px;
        font-size: 14px;
    }
    
    .popup-actions {
        flex-direction: column;
        gap: 10px;
    }
}