/* tienda/francisca/shop.css */

/* Estructura General de la Tienda B2B */
.shop-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 30px;
  margin-top: 30px;
}

@media (max-width: 992px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }
}

/* Pantalla de Login B2B */
.login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 200px);
}

.login-card {
  max-width: 450px;
  width: 100%;
  padding: 40px;
  text-align: center;
}

.login-logo {
  font-size: 3rem;
  margin-bottom: 15px;
}

.login-card h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.login-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 25px;
}

.login-card .dev-hint {
  margin-top: 20px;
  padding: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.login-card code {
  color: var(--color-accent-amber);
  font-family: monospace;
  font-weight: 600;
}

/* Cabecera del Productor */
.producer-banner {
  padding: 40px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 30px;
  align-items: center;
}

.producer-banner-glow {
  position: absolute;
  top: -50%;
  left: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
}

.producer-logo-wrapper {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  background: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 3rem;
  flex-shrink: 0;
}

.producer-info-text h1 {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.producer-info-text p {
  color: var(--text-secondary);
  margin-bottom: 0;
  max-width: 800px;
}

/* Categorías */
.shop-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 15px;
  overflow-x: auto;
}

.shop-tab {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.shop-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.shop-tab.active {
  background: var(--grad-export);
  color: white;
  border-color: transparent;
  box-shadow: var(--glow-export);
}

.shop-tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Lista de Productos B2B */
.products-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.product-b2b-card {
  padding: 30px;
}

.product-b2b-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 30px;
}

@media (max-width: 768px) {
  .product-b2b-grid {
    grid-template-columns: 1fr;
  }
}

.product-b2b-image-box {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 240px;
  border: 1px solid var(--panel-border);
}

.product-b2b-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-b2b-info h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.product-b2b-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.product-details-accordion {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
  padding: 15px;
  background: rgba(6, 8, 20, 0.4);
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
}

@media (max-width: 576px) {
  .product-details-accordion {
    grid-template-columns: 1fr;
  }
}

.details-column h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--color-accent-green);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.details-column ul {
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.details-column ul li {
  margin-bottom: 6px;
  padding-left: 14px;
  position: relative;
}

.details-column ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-accent-green);
}

.product-b2b-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
}

/* Tabla de Pedidos B2B */
.formats-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: rgba(6, 8, 20, 0.45);
}

.formats-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.formats-table th {
  background: rgba(6, 8, 20, 0.9);
  color: #ffffff;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid rgba(195, 194, 139, 0.35);
}

.formats-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--panel-border);
  vertical-align: middle;
}

.formats-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.formats-table .code-cell {
  font-family: monospace;
  color: #a0aec0;
  font-size: 0.85rem;
}

.weight-approx-tag {
  display: inline-block;
  font-size: 0.8rem;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.price-kg-cell {
  white-space: nowrap;
}

.price-kg-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #4ade80; /* Verde esmeralda luminoso de alto contraste */
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

.price-est-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-est-amount {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fde047; /* Dorado cálido de alto contraste */
}

.price-est-sub {
  font-size: 0.75rem;
  color: #94a3b8;
}

.formats-table .badge-cell {
  font-size: 0.75rem;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.quantity-control {
  display: flex;
  align-items: center;
  width: 110px;
  background: rgba(6, 8, 20, 0.7);
  border: 1px solid rgba(195, 194, 139, 0.4);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.qty-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  transition: background var(--transition-fast);
}

.qty-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #4ade80;
}

.qty-input {
  width: 46px;
  height: 32px;
  background: transparent;
  border: none;
  color: #ffffff;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Panel Lateral del Carrito B2B */
.cart-sidebar {
  position: sticky;
  top: 92px;
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-header {
  padding: 20px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h3 {
  font-size: 1.25rem;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-count-badge {
  background: var(--color-primary);
  color: white;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Lista de items del carrito */
.cart-items-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cart-item-row {
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(195, 194, 139, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.cart-item-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  padding-right: 20px;
  line-height: 1.3;
}

.cart-item-meta {
  font-size: 0.78rem;
  color: #c3c28b;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cart-item-meta-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-item-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.cart-item-subtotal-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.cart-item-subtotal-label {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cart-item-subtotal {
  font-weight: 800;
  font-size: 1.05rem;
  color: #fde047; /* Dorado de alto contraste */
}

.cart-item-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.cart-item-remove:hover {
  color: #ef4444;
}

/* Panel Logístico e Indicador de Paletización */
.cart-logistics-panel {
  padding: 20px;
  background: rgba(6, 8, 20, 0.6);
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}

.logistics-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--color-accent-blue);
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pallet-progress-group {
  margin-bottom: 15px;
}

.pallet-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.pallet-progress-bar-bg {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.pallet-progress-bar-fill {
  height: 100%;
  width: 0%;
  transition: width var(--transition-normal), background-color var(--transition-normal);
  border-radius: var(--radius-full);
}

/* Estados de la barra de paletización */
.pallet-progress-bar-fill.normal {
  background: var(--grad-import);
}

.pallet-progress-bar-fill.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.pallet-progress-bar-fill.full {
  background: var(--grad-export);
  animation: pulse-green 2s infinite;
}

.pallet-progress-bar-fill.overflow {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pallet-warning-text {
  font-size: 0.75rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  line-height: 1.3;
}

.pallet-warning-text.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.pallet-warning-text.full {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.pallet-warning-text.overflow {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.pallet-split-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
}

.pallet-split-info ul {
  list-style: none;
  margin-top: 4px;
}

.pallet-split-info li {
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
}

.pallet-split-info strong {
  color: var(--text-primary);
}

/* Totales y Formulario del Checkout */
.cart-checkout-panel {
  padding: 20px;
  background: rgba(13, 17, 39, 0.95);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cart-totals {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  color: #c3c28b;
}

.totals-row strong,
.totals-row span[id] {
  color: #ffffff;
  font-weight: 700;
}

.totals-row.grand-total {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: #ffffff;
  border-top: 1px solid rgba(195, 194, 139, 0.4);
  padding-top: 10px;
  margin-top: 4px;
  align-items: baseline;
}

.totals-row.grand-total #cart-price-total {
  color: #4ade80; /* Esmeralda luminoso */
  font-size: 1.4rem;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(74, 222, 128, 0.35);
}

.cart-est-disclaimer {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 4px;
}

.checkout-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Modal del Checkout Form */
.checkout-modal {
  max-width: 600px !important;
}

.checkout-modal-header {
  border-bottom: 1px solid var(--panel-border);
  padding: 24px;
}

.checkout-modal-body {
  padding: 24px;
}

.checkout-summary-box {
  background: rgba(6, 8, 20, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.checkout-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.summary-stat-item {
  display: flex;
  flex-direction: column;
}

.summary-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.summary-stat-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Animaciones */
.shake-animation {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.unlock-pulse {
  animation: pulse-gold 0.5s ease-out;
}

@keyframes pulse-gold {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0.7)); }
  50% { transform: scale(1.3); filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.9)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0)); }
}
