/* ===== UNIFIED CART STYLES - APPLE DESIGN ===== */

/* Cart Page Layout */
.page-cart main {
  padding-bottom: 6rem;
}

#cart-section {
  padding: 0 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

#cart-container {
  margin-bottom: 2rem;
}

/* Apple-style Cart Items */
.cart-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--light-color);
  border-radius: 16px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--gray-light);
  transition: all 0.3s ease;
}

.cart-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.cart-item-image {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f5f5f7, #e8e8ed);
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-item-details h3 {
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 1.1rem;
}

.cart-item-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--secondary-color);
}

.cart-item-price {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gray-light);
  border-radius: 8px;
  padding: 0.25rem;
}

.cart-item-qty button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--light-color);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid var(--gray-medium);
}

.cart-item-qty button:hover {
  background: var(--primary-color);
  color: var(--text-light);
}

.cart-item-qty input {
  width: 50px;
  text-align: center;
  padding: 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-dark);
  font-weight: 600;
}

.cart-item-remove {
  background: #ff3b30;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  margin-left: auto;
  border: none;
}

.cart-item-remove:hover {
  background: #d70015;
  transform: scale(1.05);
}

/* Empty Cart - Apple Style */
.empty-cart {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--secondary-color);
}

.empty-cart i {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  color: var(--gray-medium);
  opacity: 0.7;
}

.empty-cart h3 {
  margin-bottom: 1rem;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 1.5rem;
}

.empty-cart p {
  margin-bottom: 2rem;
  color: var(--secondary-color);
  font-size: 1.1rem;
}

.empty-cart-btn {
  display: inline-block;
  background: var(--primary-color);
  color: var(--text-light);
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(101, 42, 21, 0.3);
}

.empty-cart-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(101, 42, 21, 0.4);
}

/* WhatsApp Checkout Bar */
#whatsapp-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--light-color);
  padding: 1.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 990;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--gray-light);
}

.whatsapp-total {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary-color);
}

#whatsapp-checkout {
  background: #25d366;
  color: white;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
  flex: 1;
  max-width: 200px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

#whatsapp-checkout:hover {
  background: #128c7e;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

#whatsapp-checkout:disabled {
  background: var(--gray-medium);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Apple-style Mini Cart FAB */
#mini-cart-fab {
  position: fixed;
  bottom: 30px;
  right: 20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), #8b4513);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 998;
  box-shadow: 0 8px 25px rgba(101, 42, 21, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid var(--light-color);
}

#mini-cart-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 35px rgba(101, 42, 21, 0.6);
}

#mini-cart-fab .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff3b30;
  color: white;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  border: 2px solid var(--light-color);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Apple-style Cart Drawer */
#cart-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background: var(--light-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 1003;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  color: var(--text-dark);
}

#cart-drawer.active {
  right: 0;
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--light-color);
}

.drawer-header h2 {
  color: var(--primary-color);
  margin: 0;
  font-weight: 700;
  font-size: 1.5rem;
}

#drawer-close {
  background: none;
  color: var(--text-dark);
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
  border: none;
}

#drawer-close:hover {
  background: var(--gray-light);
  transform: rotate(90deg);
}

#drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.drawer-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--gray-light);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  background: var(--light-color);
  transition: var(--transition);
}

.drawer-item:hover {
  background: var(--gray-light);
}

.drawer-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: linear-gradient(135deg, #f5f5f7, #e8e8ed);
}

.drawer-item-details {
  flex: 1;
}

.drawer-item-details h4 {
  margin-bottom: 0.25rem;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.95rem;
}

.drawer-item-details p {
  margin-bottom: 0.25rem;
  color: var(--secondary-color);
  font-size: 0.8rem;
}

.drawer-item-price {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 0.9rem;
}

.drawer-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.drawer-item-qty {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--gray-light);
  border-radius: 6px;
  padding: 0.15rem;
}

.drawer-item-qty button {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--light-color);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  border: 1px solid var(--gray-medium);
}

.drawer-item-qty span {
  min-width: 25px;
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.drawer-item-remove {
  background: #ff3b30;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  border: none;
}

.drawer-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--gray-light);
  background: var(--light-color);
}

#drawer-total {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-align: center;
  padding: 1rem;
  background: var(--gray-light);
  border-radius: 12px;
}

.mini-checkout-btn {
  width: 100%;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: white;
  padding: 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
  border: none;
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.mini-checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.mini-gocart-btn {
  width: 100%;
  background: var(--primary-color);
  color: white;
  padding: 0.8rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  border: none;
  box-shadow: 0 4px 12px rgba(101, 42, 21, 0.3);
}

.mini-gocart-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(101, 42, 21, 0.4);
}

#cart-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1002;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

#cart-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Responsive Design */
@media (max-width: 767px) {
  .cart-item {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .cart-item-image {
    width: 100%;
    height: 200px;
  }
  
  .cart-item-actions {
    justify-content: center;
  }
  
  #whatsapp-bar {
    flex-direction: column;
    text-align: center;
  }
  
  .whatsapp-total {
    order: 2;
  }
  
  #whatsapp-checkout {
    order: 1;
    max-width: none;
  }
  
  #mini-cart-fab {
    width: 60px;
    height: 60px;
    font-size: 1.3rem;
    bottom: 20px;
    right: 20px;
  }
}

@media (min-width: 768px) {
  .cart-item-actions {
    justify-content: flex-start;
  }
}


/*CSS for smooth transitions for cart hint popup*/
.cart-hint-popup {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 1100;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 250px;
}

.cart-hint-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #333;
}

/* --- UI improvements appended --- */

/* === UI Improvements: Header, Theme Toggle, Logo, Cards, Checkout Button === */

/* Header visible in dark mode */
body.dark-mode header,
body.dark-mode .header, body.dark-mode .site-header {
    background-color: rgba(17,17,17,0.98) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(6px);
}

/* Light mode header */
body:not(.dark-mode) header,
body:not(.dark-mode) .header, body:not(.dark-mode) .site-header {
    background-color: rgba(255,255,255,0.96) !important;
    color: #111827 !important;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Theme toggle styles (supports id #theme-toggle and .theme-toggle) */
#theme-toggle, .theme-toggle {
    width: 52px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    padding: 4px;
    cursor: pointer;
    transition: background 240ms ease, box-shadow 240ms ease;
    background: var(--toggle-bg, #e6e6e6);
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
#theme-toggle .knob, .theme-toggle .knob {
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transform: translateX(0);
}
body.dark-mode #theme-toggle, body.dark-mode .theme-toggle {
    --toggle-bg: #3b3b3b;
}
body.dark-mode #theme-toggle .knob, body.dark-mode .theme-toggle .knob {
    transform: translateX(22px);
    background: #fafafa;
}

/* Click/tap feedback */
#theme-toggle:active .knob, .theme-toggle:active .knob {
    transform: scale(0.92);
}

/* Desktop logo bump and consistent left */
@media (min-width: 1024px) {
    .site-logo img, .header-logo img, .nav-logo img {
        height: 60px !important;
        width: auto !important;
        display: block;
    }
    header .site-logo, header .header-logo, header .nav-logo {
        margin-left: 20px !important;
        display: flex;
        align-items: center;
    }
}

/* Product card hover (subtle lift and shadow) */
.pm-card, .product-card, .card {
    transition: transform 220ms cubic-bezier(.2,.9,.3,1), box-shadow 220ms cubic-bezier(.2,.9,.3,1);
    will-change: transform, box-shadow;
}
.pm-card:hover, .product-card:hover, .card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 36px rgba(6,15,30,0.12);
}

/* Improve proceed to checkout button (reinforce) */
.checkout-btn {
    display: inline-block;
    padding: 12px 26px;
    background: linear-gradient(135deg,#ff7a00,#ff4d00);
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 8px 24px rgba(255,77,0,0.14);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
    text-decoration: none;
}
.checkout-btn:hover {
    transform: translateY(-4px);
    filter: brightness(1.05);
    box-shadow: 0 18px 40px rgba(255,77,0,0.18);
}
.checkout-btn:active {
    transform: translateY(1px) scale(0.985);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* Ensure consistent left alignment of header elements */
.header-inner, .header-container, .site-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* small tweak to ensure header z-index over content */
header, .site-header {
    position: relative;
    z-index: 9999;
}

/* Accessible focus outlines for toggle and checkout button */
#theme-toggle:focus, .theme-toggle:focus, .checkout-btn:focus {
    outline: 3px solid rgba(255,124,0,0.18);
    outline-offset: 3px;
}

/* Slight text improvement for categories title */
.category-grid p, .category-card p {
    font-weight: 600;
    letter-spacing: -0.2px;
}

/* UI Enhancements */

.proceed-global-btn {
    background: linear-gradient(135deg,#ff7a00,#ff4d00);
    padding: 14px 26px;
    color:#fff;
    border-radius:12px;
    font-weight:600;
    text-decoration:none;
    box-shadow:0 8px 20px rgba(255,77,0,.2);
    transition:all .25s ease;
}
.proceed-global-btn:hover {
    transform:translateY(-3px);
    box-shadow:0 14px 32px rgba(255,77,0,.26);
}
.proceed-global-btn:active {
    transform:scale(.96);
}

/* Premium Back-to-top button */
#back-to-top {
    position: fixed;
    bottom: 70px;
    right: 22px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg,#ff7a00,#ff4d00);
    border:none;
    border-radius:50%;
    color:#fff;
    font-size:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    box-shadow:0 8px 18px rgba(0,0,0,.25);
    transition:all .25s ease;
    z-index:9999;
}
#back-to-top:hover {
    transform:translateY(-4px);
    box-shadow:0 14px 28px rgba(0,0,0,.3);
}
#back-to-top:active {
    transform:scale(.92);
}
