/* ============================================================
   public/assets/css/main.css
   Sistema de diseño Austecol Industrial B2B
   Colores de marca: #BF7A00 (primario), #E9D700 (acentro), #333229 (oscuro)
   ============================================================ */

/* ------------------------------------------------------------
   VARIABLES CSS - Design Tokens
   ------------------------------------------------------------ */
:root {
  /* Colores de marca */
  --color-primary:       #BF7A00;
  --color-primary-hover: #A66A00;
  --color-accent:        #E9D700;
  --color-dark:          #333229;
  --color-bg:            #FFFFFF;
  --color-bg-alt:        #F5F5F3;
  --color-text:          #1A1A1A;
  --color-text-muted:    #6B6B6B;
  --color-border:        #E2E0D8;
  
  /* Colores de estado */
  --color-success:       #1D7A3A;
  --color-warning:       #C67B00;
  --color-danger:        #C0392B;
  --color-info:          #2C5282;
  
  /* Tipografía */
  --font-heading:        'Octarine', 'Montserrat', 'Inter', sans-serif;
  --font-body:           'Inter', 'Barlow', sans-serif;
  --font-technical:     'Barlow Condensed', sans-serif;
  
  /* Espaciado y dimensiones */
  --radius-sm:           4px;
  --radius-md:           8px;
  --radius-lg:           12px;
  --radius-xl:           16px;
  --radius-full:         9999px;
  
  /* Sombras */
  --shadow-sm:           0 2px 8px rgba(51,50,41,0.12);
  --shadow-md:           0 4px 16px rgba(51,50,41,0.16);
  --shadow-lg:           0 8px 32px rgba(51,50,41,0.20);
  
  /* Transiciones */
  --transition:          all 0.2s ease;
  --transition-slow:     all 0.3s ease;
  
  /* Layout */
  --max-width:           1440px;
  --container-padding:   24px;
  --header-height:       64px;
}

/* ------------------------------------------------------------
   RESET CSS
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

/* ------------------------------------------------------------
   GRID CONTENEDOR
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container-narrow {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container-wide {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ------------------------------------------------------------
   BOTONES
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-technical);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-secondary:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-ghost:hover {
  background-color: var(--color-primary);
  color: white;
}

.btn-danger {
  background-color: var(--color-danger);
  color: white;
}

.btn-danger:hover {
  background-color: #A03020;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* ------------------------------------------------------------
   CARDS DE PRODUCTO
   ------------------------------------------------------------ */
.product-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  border-left: 3px solid var(--color-accent);
  transform: translateY(-2px);
}

.product-card__image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background-color: var(--color-bg-alt);
}

.product-card__content {
  padding: 1.25rem;
}

.product-card__title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.product-card__sku {
  font-family: var(--font-technical);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.product-card__price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.product-card__badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background-color: var(--color-accent);
  color: var(--color-dark);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ------------------------------------------------------------
   HEADER STICKY
   ------------------------------------------------------------ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: white;
  box-shadow: var(--shadow-sm);
}

.header-top {
  background-color: var(--color-dark);
  color: white;
  padding: 0.5rem 0;
  font-size: 0.75rem;
}

.header-top__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-main {
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.header-main__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.header-main__logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-main__logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-main__search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header-main__search input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  transition: var(--transition);
}

.header-main__search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(191, 122, 0, 0.1);
}

.header-main__search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}

.header-main__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-main__action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-primary);
  transition: var(--transition);
  text-decoration: none;
}

.header-main__action:hover {
  background-color: var(--color-bg-alt);
}

/* ------------------------------------------------------------
   BADGES DE ESTADO
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-enviada {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.badge-en_revision {
  background-color: var(--color-primary);
  color: white;
}

.badge-aprobada {
  background-color: var(--color-success);
  color: white;
}

.badge-rechazada {
  background-color: var(--color-danger);
  color: white;
}

.badge-vencida {
  background-color: #888888;
  color: white;
}

.badge-borrador {
  background-color: var(--color-text-muted);
  color: white;
}

/* ------------------------------------------------------------
   TABLA BASE
   ------------------------------------------------------------ */
.tabla-austecol {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.tabla-austecol th {
  background-color: var(--color-dark);
  color: white;
  font-family: var(--font-technical);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  text-align: left;
}

.tabla-austecol td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.tabla-austecol tr:hover {
  background-color: var(--color-bg-alt);
}

.tabla-austecol tr:last-child td {
  border-bottom: none;
}

.tabla-austecol--striped tbody tr:nth-child(even) {
  background-color: var(--color-bg-alt);
}

.tabla-austecol--compact th,
.tabla-austecol--compact td {
  padding: 0.5rem 0.75rem;
}

/* ------------------------------------------------------------
   FORMULARIOS
   ------------------------------------------------------------ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-family: var(--font-technical);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-label--required::after {
  content: ' *';
  color: var(--color-danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: var(--font-body);
  transition: var(--transition);
  background-color: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(191, 122, 0, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-primary);
}

.form-error {
  color: var(--color-danger);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.form-hint {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* ------------------------------------------------------------
   RESPONSIVE BREAKPOINTS
   ------------------------------------------------------------ */
@media (max-width: 1280px) {
  :root {
    --container-padding: 20px;
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 16px;
  }
  
  .header-main {
    flex-wrap: wrap;
  }
  
  .header-main__search {
    order: 3;
    width: 100%;
    max-width: none;
    margin-top: 1rem;
  }
  
  .tabla-austecol {
    font-size: 0.75rem;
  }
  
  .tabla-austecol th,
  .tabla-austecol td {
    padding: 0.5rem;
  }
  
  .product-card__content {
    padding: 1rem;
  }
}

@media (max-width: 375px) {
  :root {
    --container-padding: 12px;
  }
  
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.75rem;
  }
  
  .header-main__logo-text {
    font-size: 1.25rem;
  }
}

/* ------------------------------------------------------------
   HEADER 3 BANDAS + MEGAMENÚ
   ------------------------------------------------------------ */

/* ── TOP BAND ── */
.band-top {
  background: #333229;
  padding: 6px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.band-top-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.band-top-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #D3D1C7;
}
.band-top-item .material-symbols-outlined {
  font-size: 14px;
  color: #BF7A00;
}
.band-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.band-link {
  font-size: 11px;
  color: #D3D1C7;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.band-link:hover {
  color: #E9D700;
}
.band-sep {
  color: #5F5E5A;
  font-size: 10px;
}
.band-badge {
  background: #BF7A00;
  color: #fff;
  font-size: 10px;
  padding: 2px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.band-badge:hover {
  background: #A66A00;
}

/* ── MAIN BAND ── */
.band-main {
  background: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #E2E0D8;
}

/* Search wrapper */
.search-wrap {
  flex: 1;
  position: relative;
  max-width: 640px;
}
.search-inner {
  display: flex;
  align-items: stretch;
  height: 40px;
  border: 1.5px solid #BF7A00;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-inner:focus-within {
  border-color: #A66A00;
  box-shadow: 0 0 0 3px rgba(191,122,0,0.1);
}
.search-cat-select {
  width: 165px;
  min-width: 165px;
  flex-shrink: 0;
  border: none;
  border-right: 1px solid #D7C3AF;
  background: #F5F5F3;
  font-size: 11px;
  color: #5F5E5A;
  cursor: pointer;
  padding: 0 20px 0 10px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%235F5E5A'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px;
  outline: none;
  font-weight: 500;
}
.search-box {
  flex: 1;
  border: none;
  height: 40px;
  padding: 0 44px 0 12px;
  font-size: 13px;
  color: #1A1A1A;
  outline: none;
  background: transparent;
}
.search-box::placeholder {
  color: #9C9C9C;
}
.search-btn {
  position: absolute;
  right: 0;
  top: 0;
  height: 40px;
  width: 42px;
  background: #BF7A00;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}
.search-btn:hover {
  background: #A66A00;
}
.search-btn .material-symbols-outlined {
  color: #fff;
  font-size: 20px;
}
#autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #D7C3AF;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(51,50,41,0.16);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
}

/* ── ACTION BUTTONS ── */
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #1A1A1A;
  min-width: 50px;
  position: relative;
  text-decoration: none;
  transition: background 0.15s;
}
.action-btn:hover {
  background: #F5F5F3;
}
.action-btn .material-symbols-outlined {
  font-size: 22px;
  color: #333229;
}
.action-label {
  font-size: 9px;
  color: #6B6B6B;
  white-space: nowrap;
  font-weight: 500;
}
.action-badge {
  position: absolute;
  top: 2px;
  right: 8px;
  background: #BF7A00;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
}
.btn-access {
  background: #BF7A00;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: background 0.15s;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.btn-access:hover {
  background: #A66A00;
}
.btn-access .material-symbols-outlined {
  font-size: 16px;
}

/* ── NAV BAND ── */
.band-nav {
  background: #333229;
  padding: 0 24px;
  display: flex;
  align-items: stretch;
  position: relative;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #D3D1C7;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  position: relative;
  cursor: pointer;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.nav-item:hover,
.nav-item.active {
  color: #E9D700;
  border-bottom-color: #E9D700;
}
.nav-item .material-symbols-outlined {
  font-size: 16px;
}
.nav-item .arrow-down {
  font-size: 14px;
  opacity: 0.7;
}
.nav-divider {
  width: 1px;
  background: #444441;
  margin: 8px 0;
  flex-shrink: 0;
}
.nav-ofertas {
  color: #E9D700 !important;
}
.nav-ofertas:hover {
  color: #fff !important;
  border-bottom-color: #E9D700 !important;
}

/* ── MEGA-DROPDOWN ── */
.nav-item-categorias {
  position: static;
}
.mega-dropdown {
  position: absolute;
  top: 100%;
  left: 24px;
  right: 24px;
  margin-top: -3px;
  max-width: 1024px;
  background: #fff;
  border: 1px solid #BFA386;
  border-top: 3px solid #BF7A00;
  border-radius: 0 0 10px 10px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  box-shadow: 0 12px 40px rgba(51,50,41,0.2);
}
.nav-item-categorias:hover .mega-dropdown,
.mega-dropdown:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: all;
}
.mega-col-title {
  font-size: 11px;
  font-weight: 600;
  color: #BF7A00;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Barlow Condensed', sans-serif;
}
.mega-col-title .material-symbols-outlined {
  font-size: 16px;
}
.mega-cat-group {
  margin-bottom: 6px;
}
.mega-cat-name {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A1A;
  text-decoration: none;
  display: block;
  padding: 3px 0;
  transition: color 0.15s;
}
.mega-cat-name:hover {
  color: #BF7A00;
}
.mega-subs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 8px;
  padding-left: 6px;
  border-left: 2px solid #E2E0D8;
}
.mega-link {
  font-size: 12px;
  color: #6B6B6B;
  text-decoration: none;
  padding: 2px 0 2px 8px;
  transition: color 0.15s;
  display: block;
}
.mega-link:hover {
  color: #BF7A00;
}
.mega-link-all {
  font-size: 11px;
  font-weight: 600;
  color: #BF7A00;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 0;
  transition: color 0.15s;
}
.mega-link-all:hover {
  color: #A66A00;
}
.mega-promo {
  background: #FFF5E6;
  border-radius: 8px;
  padding: 14px;
  border: 1px solid #FAC775;
}
.mega-promo-tag {
  font-size: 10px;
  font-weight: 600;
  color: #854F0B;
  background: #FAC775;
  padding: 2px 10px;
  border-radius: 10px;
  display: inline-block;
}
.mega-promo-title {
  font-size: 13px;
  font-weight: 600;
  color: #412402;
  margin-top: 8px;
}
.mega-promo-sub {
  font-size: 11px;
  color: #633806;
  margin-top: 4px;
}
.mega-promo-cta {
  font-size: 11px;
  color: #BF7A00;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  text-decoration: none;
}
.mega-promo-cta:hover {
  color: #A66A00;
}

/* ── FULL WIDTH SEARCH IN HEADER ── */
#search-wrapper {
  position: relative;
}

/* ── RESPONSIVE HEADER ── */
@media (max-width: 1023px) {
  .band-top { display: none; }
  .band-nav { display: none; }
  .band-main { padding: 10px 16px; }
  .search-wrap { max-width: none; }
  .action-label { display: none; }
  .btn-access span:not(.material-symbols-outlined) { display: none; }
  .btn-access { padding: 8px 10px; }
}

@media (max-width: 640px) {
  .band-main { gap: 8px; }
  .action-btn { padding: 6px 6px; min-width: 38px; }
  .action-btn .material-symbols-outlined { font-size: 20px; }
}

@media (max-width: 480px) {
  .search-cat-select { display: none; }
  .search-box { padding-left: 10px; }
}

/* ------------------------------------------------------------
   UTILIDADES ADICIONALES
   ------------------------------------------------------------ */
.text-primary {
  color: var(--color-primary);
}

.text-accent {
  color: var(--color-accent);
}

.text-dark {
  color: var(--color-dark);
}

.text-muted {
  color: var(--color-text-muted);
}

.bg-primary {
  background-color: var(--color-primary);
}

.bg-accent {
  background-color: var(--color-accent);
}

.bg-dark {
  background-color: var(--color-dark);
}

.border-primary {
  border-color: var(--color-primary);
}

.rounded-sm {
  border-radius: var(--radius-sm);
}

.rounded-md {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transition {
  transition: var(--transition);
}

.transition-slow {
  transition: var(--transition-slow);
}
