/* ============================================
   CART PAGE - FRACTAL STYLE
   ============================================ */

/* ============================================
   FIX: Mantener header y menú intactos en carrito
   ============================================ */

/* Asegura que el header de Astra conserve su layout */
header.site-header,
#masthead,
.ast-main-header-bar,
.ast-primary-header-bar {
  display: block !important;
  flex-direction: initial !important;
  align-items: initial !important;
}

/* Elimina posibles herencias flex del form global */
.woocommerce-cart .woocommerce,
.woocommerce-cart form {
  display: block !important;
}

/* Corrige el ícono del carrito de Astra */
.ast-site-header-cart .ast-addon-cart-wrap {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
}

/* Ajusta el precio junto al ícono */
.ast-woo-header-cart-total {
  display: inline-block !important;
  font-size: 15px !important;
  color: #1a202c !important;
  margin-left: 4px;
  white-space: nowrap;
}

body.woocommerce-cart {
  background: #f5f7fa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Hero */
.cart-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 150px 20px;
  text-align: center;
  color: #fff;

  overflow: hidden;
}

.cart-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.cart-hero-content {
  position: relative;
  z-index: 1;
}

.cart-hero-title {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.9);
}

.cart-hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
}

/* Layout */
.cart-container {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  max-width: 90%;
  margin: -60px auto 80px;
  align-items: start;
}

/* Table */
.cart-table-wrapper {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow-x: auto;
}

.shop_table th {
  color: #4a5568;
  font-weight: 600;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f2f5;
  text-transform: uppercase;
  font-size: 13px;
}

.shop_table td {
  padding: 16px 12px;
  border-bottom: 1px solid #f0f2f5;
  color: #2d3748;
  vertical-align: middle;
}

.product-thumbnail img {
  width: 70px;
  border-radius: 10px;
}

.product-name a {
  color: #1a202c;
  text-decoration: none;
  font-weight: 600;
}

.product-name a:hover {
  color: #667eea;
}

.product-remove .remove {
  color: #e53e3e;
  font-size: 22px;
  text-decoration: none;
}

/* Totals */
.cart-totals-section {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 30px;
}

.cart-totals-section h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 16px;
}

.btn-primary {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 14px 0;
  border-radius: 12px;
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
  color: #fff;
}

/* Empty Cart */
.empty-cart-container {
  max-width: 700px;
  margin: -60px auto 80px;
  text-align: center;
}

.empty-cart-box {
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.empty-cart-box p {
  color: #2d3748;
  font-size: 16px;
  margin-bottom: 24px;
}

.icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

/* Responsive */
@media (max-width: 1024px) {
  .cart-container {
    grid-template-columns: 1fr;
  }

  .cart-totals-section {
    position: relative;
    top: 0;
  }
}
