/* ═══════════════════════════════════════════
   INSTACART CHILD THEME — shop.css
   ═══════════════════════════════════════════ */

:root {
  --ic-green:       #0aad0a;
  --ic-green-dark:  #089008;
  --ic-green-light: #e8f8e8;
  --ic-gray-50:     #f9fafb;
  --ic-gray-100:    #f3f4f6;
  --ic-gray-200:    #e5e7eb;
  --ic-gray-300:    #d1d5db;
  --ic-gray-400:    #9ca3af;
  --ic-gray-500:    #6b7280;
  --ic-gray-600:    #4b5563;
  --ic-gray-700:    #374151;
  --ic-gray-800:    #1f2937;
  --ic-gray-900:    #111827;
  --ic-white:       #ffffff;
  --ic-radius:      8px;
  --ic-radius-lg:   12px;
  --ic-radius-full: 9999px;
  --ic-shadow:      0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --ic-shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --ic-shadow-xl:   0 20px 25px rgba(0,0,0,.10), 0 10px 10px rgba(0,0,0,.04);
  --ic-font:        'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── RESET STOREFRONT ── */
body.woocommerce, body.woocommerce-page {
  font-family: var(--ic-font) !important;
  background: var(--ic-gray-50) !important;
}
.storefront-full-width-content .col-full,
.col-full { max-width: 100% !important; padding: 0 !important; }

/* ── HEADER ── */
.site-header {
  background: var(--ic-white) !important;
  border-bottom: 1px solid var(--ic-gray-200) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.05) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
}
.site-header .col-full {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 12px 24px !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
}
/* Ocultar elementos del header de Storefront que no necesitamos */
.storefront-handheld-footer-bar,
.storefront-sorting-wrapper { display: none !important; }

/* Cart button en header */
.ic-header-cart-wrap { margin-left: auto; }
.ic-btn-cart {
  display: flex; align-items: center; gap: 8px;
  background: var(--ic-green); color: var(--ic-white);
  border: none; border-radius: var(--ic-radius-full);
  padding: 10px 20px; font-family: var(--ic-font);
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
.ic-btn-cart:hover { background: var(--ic-green-dark); transform: translateY(-1px); }
.ic-cart-count {
  background: var(--ic-white); color: var(--ic-green);
  border-radius: var(--ic-radius-full);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.ic-cart-total-btn { font-weight: 600; }

/* ── SHOP LAYOUT ── */
.ic-shop-layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 65px);
}

/* ── SIDEBAR ── */
.ic-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--ic-white);
  border-right: 1px solid var(--ic-gray-200);
  padding: 24px 0;
  position: sticky; top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
}
.ic-sidebar::-webkit-scrollbar { width: 4px; }
.ic-sidebar::-webkit-scrollbar-thumb { background: var(--ic-gray-200); border-radius: 2px; }
.ic-sidebar-section { margin-bottom: 8px; }
.ic-sidebar-title {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: var(--ic-gray-400); text-transform: uppercase;
  padding: 8px 20px 6px;
}
.ic-sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--ic-gray-700);
  transition: background .15s, color .15s;
  border: none; background: none; width: 100%; text-align: left;
}
.ic-sidebar-item:hover { background: var(--ic-gray-50); color: var(--ic-gray-900); }
.ic-sidebar-item.active {
  background: var(--ic-green-light); color: var(--ic-green-dark); font-weight: 600;
}
.ic-sidebar-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ic-gray-300); flex-shrink: 0;
}
.ic-sidebar-item.active .ic-sidebar-dot { background: var(--ic-green); }
.ic-sidebar-divider { height: 1px; background: var(--ic-gray-100); margin: 12px 0; }

/* ── MAIN ── */
.ic-main-content { flex: 1; padding: 32px; overflow-x: hidden; }

/* ── CATEGORIES ROW ── */
.ic-categories-row {
  display: flex; gap: 12px; overflow-x: auto;
  padding-bottom: 4px; margin-bottom: 32px;
  scrollbar-width: none;
}
.ic-categories-row::-webkit-scrollbar { display: none; }
.ic-cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 16px; background: var(--ic-white);
  border: 1.5px solid var(--ic-gray-200); border-radius: var(--ic-radius-lg);
  cursor: pointer; flex-shrink: 0; min-width: 90px;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.ic-cat-card:hover { border-color: var(--ic-green); box-shadow: var(--ic-shadow-md); transform: translateY(-2px); }
.ic-cat-card.active { border-color: var(--ic-green); background: var(--ic-green-light); }
.ic-cat-icon { font-size: 26px; line-height: 1; }
.ic-cat-label { font-size: 12px; font-weight: 600; color: var(--ic-gray-700); text-align: center; white-space: nowrap; }

/* ── SECTION HEADER ── */
.ic-section-header { margin-bottom: 18px; }
.ic-section-title { font-size: 20px; font-weight: 700; color: var(--ic-gray-900); }

/* ── PRODUCTS WRAP — override WC grid ── */
.ic-products-wrap ul.products,
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important;
  gap: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* ── PRODUCT CARD ── */
.woocommerce ul.products li.product {
  background: var(--ic-white) !important;
  border: 1.5px solid var(--ic-gray-200) !important;
  border-radius: var(--ic-radius-lg) !important;
  overflow: hidden !important;
  transition: box-shadow .2s, transform .15s, border-color .2s !important;
  cursor: pointer !important;
  position: relative !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}
.woocommerce ul.products li.product:hover {
  box-shadow: var(--ic-shadow-md) !important;
  transform: translateY(-2px) !important;
  border-color: var(--ic-gray-300) !important;
}

/* Imagen */
.woocommerce ul.products li.product a img {
  display: block !important;
  width: 100% !important;
  height: 160px !important;
  object-fit: contain !important;
  background: var(--ic-gray-50) !important;
  padding: 16px !important;
  transition: transform .3s !important;
}
.woocommerce ul.products li.product:hover a img { transform: scale(1.05) !important; }

/* Badge oferta */
.ic-product-badge {
  position: absolute; top: 8px; left: 8px;
  background: #ef4444; color: var(--ic-white);
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: var(--ic-radius-full);
  z-index: 2;
}

/* Body */
.woocommerce ul.products li.product .ic-product-price,
.woocommerce ul.products li.product .ic-product-name,
.woocommerce ul.products li.product .ic-product-meta,
.woocommerce ul.products li.product .ic-product-stock,
.woocommerce ul.products li.product .ic-add-wrap {
  padding: 0 14px;
}
.woocommerce ul.products li.product .ic-product-price {
  font-size: 17px; font-weight: 700;
  color: var(--ic-gray-900); margin: 12px 14px 4px;
  padding: 0;
}
/* WC sale price markup */
.woocommerce ul.products li.product .ic-product-price ins {
  text-decoration: none; font-weight: 700;
}
.woocommerce ul.products li.product .ic-product-price del {
  font-size: 13px; font-weight: 400;
  color: var(--ic-gray-400); margin-left: 4px;
  opacity: 1 !important;
}
.woocommerce ul.products li.product .ic-product-name {
  font-size: 13px; color: var(--ic-gray-600);
  line-height: 1.4; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  padding: 0 14px;
}
.ic-product-meta {
  font-size: 11px; color: var(--ic-gray-400);
  margin-bottom: 6px; padding: 0 14px;
}
.ic-stars { color: #f59e0b; font-size: 12px; }
.ic-product-stock {
  font-size: 11px; font-weight: 500;
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 10px; padding: 0 14px;
}
.ic-product-stock.in-stock { color: var(--ic-green); }
.ic-product-stock.out-stock { color: #ef4444; }
.ic-stock-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ── ADD BUTTON ── */
.ic-add-wrap { padding: 0 14px 14px !important; }
.ic-btn-add {
  width: 100%; background: var(--ic-green); color: var(--ic-white);
  border: none; border-radius: var(--ic-radius-full);
  padding: 9px 16px; font-family: var(--ic-font);
  font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .2s;
}
.ic-btn-add:hover:not(:disabled) { background: var(--ic-green-dark); }
.ic-btn-add.ic-btn-disabled { background: var(--ic-gray-300); cursor: not-allowed; }
.ic-btn-add.loading { opacity: .7; pointer-events: none; }

/* Qty control */
.ic-qty-control {
  width: 100%; display: flex; align-items: center;
  justify-content: space-between;
  background: var(--ic-green); border-radius: var(--ic-radius-full);
  padding: 4px;
}
.ic-qty-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.2); color: var(--ic-white);
  border: none; font-size: 20px; line-height: 1;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: background .15s; flex-shrink: 0;
}
.ic-qty-btn:hover { background: rgba(255,255,255,.35); }
.ic-qty-num { color: var(--ic-white); font-weight: 700; font-size: 16px; flex: 1; text-align: center; }

/* ── CART DRAWER ── */
.ic-cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 9998; opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.ic-cart-overlay.open { opacity: 1; pointer-events: all; }
.ic-cart-drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 400px; background: var(--ic-white);
  z-index: 9999; display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--ic-shadow-xl);
}
.ic-cart-drawer.open { transform: translateX(0); }
.ic-cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--ic-gray-200);
}
.ic-cart-title { font-size: 20px; font-weight: 700; }
.ic-cart-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ic-gray-100); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background .15s; font-family: var(--ic-font);
}
.ic-cart-close:hover { background: var(--ic-gray-200); }
.ic-cart-store {
  padding: 12px 24px; background: var(--ic-green-light);
  border-bottom: 1px solid var(--ic-gray-200);
  font-size: 13px; font-weight: 600; color: var(--ic-green-dark);
}
.ic-cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; }
.ic-cart-items::-webkit-scrollbar { width: 4px; }
.ic-cart-items::-webkit-scrollbar-thumb { background: var(--ic-gray-200); }
.ic-cart-item {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--ic-gray-100); align-items: center;
}
.ic-cart-item:last-child { border-bottom: none; }
.ic-cart-item-img {
  width: 60px; height: 60px; object-fit: contain;
  border-radius: var(--ic-radius); background: var(--ic-gray-50);
  border: 1px solid var(--ic-gray-100); flex-shrink: 0; padding: 4px;
}
.ic-cart-item-info { flex: 1; min-width: 0; }
.ic-cart-item-name { font-size: 13px; font-weight: 500; color: var(--ic-gray-800); line-height: 1.3; margin-bottom: 4px; }
.ic-cart-item-price { font-size: 12px; color: var(--ic-gray-500); }
.ic-cart-item-qty {
  display: flex; align-items: center; gap: 6px;
  background: var(--ic-green); border-radius: var(--ic-radius-full);
  padding: 3px; flex-shrink: 0;
}
.ic-cart-qty-btn {
  width: 28px; height: 28px; background: rgba(255,255,255,.2);
  border: none; color: var(--ic-white); border-radius: 50%; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: background .15s; font-family: var(--ic-font);
}
.ic-cart-qty-btn:hover { background: rgba(255,255,255,.35); }
.ic-cart-qty-num { color: var(--ic-white); font-weight: 700; font-size: 14px; min-width: 20px; text-align: center; }
.ic-cart-item-total { font-size: 14px; font-weight: 700; color: var(--ic-gray-900); flex-shrink: 0; }
.ic-cart-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--ic-gray-400); gap: 12px; padding: 60px 20px;
  text-align: center;
}
.ic-cart-empty-icon { font-size: 64px; opacity: .4; }
.ic-cart-empty h3 { font-size: 18px; font-weight: 600; color: var(--ic-gray-600); margin: 0; }
.ic-cart-empty p { font-size: 14px; margin: 0; }
.ic-cart-footer { padding: 20px 24px; border-top: 1px solid var(--ic-gray-200); }
.ic-cart-subtotal {
  display: flex; justify-content: space-between;
  font-size: 14px; color: var(--ic-gray-600); margin-bottom: 8px;
}
.free-ship { color: var(--ic-green) !important; font-weight: 600; }
.ic-cart-total {
  display: flex; justify-content: space-between;
  font-size: 18px; font-weight: 700; color: var(--ic-gray-900);
  margin-bottom: 16px; padding-top: 10px;
  border-top: 1px solid var(--ic-gray-200);
}
.ic-btn-checkout {
  display: block; width: 100%; background: var(--ic-green); color: var(--ic-white) !important;
  border: none; border-radius: var(--ic-radius-full);
  padding: 14px; font-family: var(--ic-font);
  font-size: 16px; font-weight: 700; cursor: pointer;
  text-align: center; text-decoration: none !important;
  transition: background .2s, transform .1s;
}
.ic-btn-checkout:hover { background: var(--ic-green-dark) !important; color: var(--ic-white) !important; transform: translateY(-1px); }

/* ── TOAST ── */
.ic-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ic-gray-900); color: var(--ic-white);
  padding: 12px 24px; border-radius: var(--ic-radius-full);
  font-size: 14px; font-weight: 500; z-index: 99999;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  white-space: nowrap; pointer-events: none;
}
.ic-toast.show { transform: translateX(-50%) translateY(0); }

/* ── CHECKOUT PAGE ── */
.woocommerce-checkout .woocommerce { max-width: 980px; margin: 0 auto; padding: 32px !important; }
.woocommerce-checkout #customer_details,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review { /* natural WC layout */ }
.woocommerce-checkout .woocommerce-checkout-review-order-table { width: 100%; border-collapse: collapse; }
.woocommerce-checkout .form-row input.input-text,
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
  border: 1.5px solid var(--ic-gray-200) !important;
  border-radius: var(--ic-radius) !important;
  padding: 11px 14px !important;
  font-family: var(--ic-font) !important;
  font-size: 14px !important;
  transition: border-color .2s, box-shadow .2s !important;
}
.woocommerce-checkout .form-row input.input-text:focus,
.woocommerce-checkout .form-row select:focus {
  border-color: var(--ic-green) !important;
  box-shadow: 0 0 0 3px rgba(10,173,10,.1) !important;
  outline: none !important;
}
#place_order {
  background: var(--ic-green) !important;
  border-radius: var(--ic-radius-full) !important;
  font-family: var(--ic-font) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  padding: 14px 32px !important;
  transition: background .2s !important;
}
#place_order:hover { background: var(--ic-green-dark) !important; }

/* ── RESPONSIVE ── */
/* ── OCULTAR SIDEBAR DERECHO DE STOREFRONT ── */
.site-main .widget-area,
#secondary,
.storefront-widget-area,
.site-main aside {
    display: none !important;
}

/* ── OCULTAR CARRITO ORIGINAL DE STOREFRONT ── */
.site-header .site-header-cart,
.storefront-header-cart,
.site-header ul.cart-contents {
    display: none !important;
}

/* ── FULL WIDTH ── */
.site-main,
.site-content .col-full,
#primary {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce-page .site-main,
.woocommerce .site-main {
    width: 100% !important;
}

@media (max-width: 900px) {
  .ic-sidebar { display: none !important; }
  .ic-main-content { padding: 16px !important; }
  .ic-cart-drawer { width: 100% !important; }
  .woocommerce ul.products { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 480px) {
  .woocommerce ul.products { grid-template-columns: 1fr !important; }
}