/* CSS Variables - Industrial Premium Aesthetic */
:root {
    --primary-red: #E30613;
    --primary-red-hover: #C1040F;
    --dark: #1A1A1A;
    --dark-muted: #2A2A2A;
    --gray-dark: #4A4A4A;
    --gray-medium: #8F8F8F;
    --gray-light: #E5E7EB;
    --background: #F9FAFB;
    --white: #FFFFFF;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    
    --transition: all 0.3s ease;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    background-color: var(--background);
}

body {
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography & Utilities */
.text-red {
    color: var(--primary-red);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-red-hover);
    border-color: var(--primary-red-hover);
    box-shadow: 0 0 15px rgba(227, 6, 19, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: var(--dark);
    border: 2px solid var(--gray-light);
}

.btn-outline:hover {
    border-color: var(--dark);
    background-color: var(--dark);
    color: var(--white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Top Bar */
.top-bar {
    background-color: var(--dark);
    color: var(--gray-light);
    font-size: 0.85rem;
    padding: 5px 0;
    border-bottom: 2px solid var(--primary-red);
}

.top-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping for mobile */
}

.top-bar-left, .top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-bar i {
    color: var(--primary-red);
    margin-right: 4px;
}

.top-bar a {
    transition: var(--transition);
}

.top-bar a:hover {
    color: var(--white);
}

.top-bar .divider {
    color: var(--gray-dark);
}

/* Header */
.header {
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-light);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 0;
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0;
    min-height: auto;
}

.logo {
    display: flex;
    align-items: center;
    height: 60px; 
}

.logo a {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.logo h1 span {
    color: var(--primary-red);
}

.logo-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-medium);
    letter-spacing: 2px;
}

.main-nav ul {
    display: flex;
    gap: 32px;
}

.main-nav a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--gray-dark);
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--primary-red);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-red);
    transition: var(--transition);
}

.main-nav a:hover::after, .main-nav a.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: flex-end; /* Push nav to the right side of its grid column to center logo */
}

.cart-btn {
    background-color: var(--dark);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.cart-btn:hover {
    background-color: var(--primary-red);
}

.cart-badge {
    background-color: var(--white);
    color: var(--primary-red);
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -8px;
    right: -8px;
    box-shadow: var(--shadow-sm);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
    cursor: pointer;
}

/* Hero Section */
.hero {
    position: relative;
    background-color: var(--dark);
    color: var(--white);
    padding: 30px 0; /* Adjusted for better spacing */
    overflow: hidden;
    background-image: url('../img/obrero_soldando.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26,26,26,0.75) 0%, rgba(42,42,42,0.65) 100%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1;
}

.text-center {
    text-align: center;
}

.justify-center {
    justify-content: center;
}

.hero-main-logo {
    max-height: 480px; /* Even more for the cropped version */
    width: 90%; 
    max-width: 700px; /* Increased width */
    display: block;
    margin: 0 auto 30px auto; /* Increased from 5px for better breathing room */
    object-fit: contain;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 20px; /* Slightly more padding */
    border-radius: 50px;
    font-size: 1rem; /* Increased from 0.875rem */
    font-weight: 700; /* Increased weight */
    letter-spacing: 1.5px;
    margin-bottom: 25px; /* Increased from 10px */
    text-transform: uppercase;
}

.hero h2 {
    font-size: 4rem;
    margin-bottom: 5px; /* Reduced from 10px */
    line-height: 1.1;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.25rem;
    color: #cbd5e1;
    margin-bottom: 15px; /* Reduced from 20px */
    max-width: 650px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
}

.hero-buttons .btn-outline {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
}

.hero-buttons .btn-outline:hover {
    background-color: var(--white);
    color: var(--dark);
}

/* Abstract shapes for industrial feel */
.hero-shape {
    position: absolute;
    background-color: var(--primary-red);
    opacity: 0.8;
    z-index: 1;
}

.hero-shape-1 {
    width: 300px;
    height: 800px;
    transform: rotate(35deg);
    right: -100px;
    top: -200px;
    mix-blend-mode: overlay;
}

.hero-shape-2 {
    width: 100px;
    height: 100px;
    border: 10px solid var(--white);
    opacity: 0.05;
    bottom: 50px;
    left: 10%;
}

/* Company Section (Empresa) */
.company-section {
    padding: 80px 0;
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-light);
}

.company-grid {
    display: block;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.company-content h2 {
    font-size: 2.5rem;
    margin-bottom: 24px;
    color: var(--dark);
}

.company-content p {
    font-size: 1.1rem;
    color: var(--gray-dark);
    margin-bottom: 16px;
    text-align: left; /* Keep paragraphs readable */
}

.features-mini-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.feature-item i {
    font-size: 1.5rem;
    color: var(--primary-red);
}

.company-image img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Contact Section */
.contact-section {
    padding: 80px 0;
    background-color: var(--background);
}

.contact-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 40px;
}

.contact-form-container {
    background-color: var(--white);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-light);
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background-color: #FAFAFA;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
    background-color: var(--white);
}

.contact-info-card {
    background-color: var(--dark);
    color: var(--white);
    padding: 40px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
}

.contact-info-card h3 {
    margin-bottom: 24px;
    font-size: 1.5rem;
}

.info-list {
    display: flex;
    flex-direction: column;
    opacity: 0.9;
    margin-bottom: 5px; /* Tighter spacing below paragraph */
}

.info-list li.nav {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: flex-end; /* Push nav to the right side of its grid column */
}

.info-list li {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.info-list li i {
    font-size: 1.25rem;
    color: var(--primary-red);
    margin-top: 4px;
}

.info-list li strong {
    display: block;
    margin-bottom: 4px;
    color: var(--white);
}

.info-list li span {
    color: var(--gray-medium);
    font-size: 0.95rem;
}

.map-container {
    flex-grow: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    min-height: 200px;
}

/* Catalog Section */
.catalog-section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.section-header p {
    color: var(--gray-dark);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.catalog-layout-unified {
    width: 100%;
    margin: 0 auto;
}

/* Search Grid (Search App Style) */
.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    background: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-light);
}

.search-grid .filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-grid .filter-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-grid .filter-group select,
.search-grid .filter-group input {
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-light);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.search-grid .filter-group select:focus,
.search-grid .filter-group input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.search-grid .full-width {
    grid-column: 1 / -1;
}

.search-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 10px;
}

/* Variants Table (Search App Style) */
.variant-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Custom Qty Stepper Styles */
.qty-stepper {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 8px;
}

.stepper-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    color: var(--dark);
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

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

.stepper-btn:active {
    transform: scale(0.9);
}

.qty-stepper input[type="number"] {
    width: 38px;
    height: 28px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
    -moz-appearance: textfield;
    appearance: none;
}

.qty-stepper input[type="number"]::-webkit-outer-spin-button,
.qty-stepper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.attr-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attr-selector label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-medium);
    text-transform: uppercase;
}

.choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.choice-btn {
    padding: 6px 12px;
    border: 1px solid var(--gray-light);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.choice-btn:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.choice-btn.active {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

.choice-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.fixed-val {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

/* Auth Name Styles */
.user-name {
    font-weight: 700;
    color: var(--dark);
}

.search-box {
    position: relative;
    margin-bottom: 30px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-medium);
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

.filter-group {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-light);
}

.filter-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-group h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom Scrollbar */
.filter-options::-webkit-scrollbar {
    width: 6px;
}
.filter-options::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.filter-options::-webkit-scrollbar-thumb {
    background: var(--gray-light);
    border-radius: 10px;
}
.filter-options::-webkit-scrollbar-thumb:hover {
    background: var(--gray-medium);
}

/* Checkboxes */
.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--gray-dark);
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--white);
    border: 1px solid var(--gray-medium);
    border-radius: 3px;
    transition: var(--transition);
}

.custom-checkbox:hover input ~ .checkmark {
    border-color: var(--primary-red);
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Product List Area */
.catalog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-light);
}

#results-count {
    color: var(--gray-dark);
    font-weight: 500;
}

.product-list-header {
    display: grid;
    grid-template-columns: 110px 2fr 1.5fr 2fr 120px 140px; /* Code Desc Brand Piece Price Action */
    gap: 16px;
    padding: 12px 16px;
    background-color: var(--dark);
    color: var(--white);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-list-header > div {
    color: var(--white);
}

.product-list {
    background-color: var(--white);
    border: 1px solid var(--gray-light);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    max-height: 85vh; /* Uniform increased height */
    overflow-y: auto;
}

/* Custom Scrollbar for Product List */
.product-list::-webkit-scrollbar {
    width: 8px;
}
.product-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.product-list::-webkit-scrollbar-thumb {
    background: var(--gray-light);
    border-radius: 4px;
}
.product-list::-webkit-scrollbar-thumb:hover {
    background: var(--gray-medium);
}

/* Product Row */
.product-row {
    display: grid;
    grid-template-columns: 110px 2fr 1.5fr 2fr 120px 140px; /* Code Desc Brand Piece Price Action */
    gap: 16px;
    padding: 12px 16px;
    align-items: center;
    border-bottom: 1px solid var(--gray-light);
    transition: var(--transition);
}

.product-row:hover {
    background-color: rgba(227, 6, 19, 0.03);
}

.product-row:last-child {
    border-bottom: none;
}

.col-code {
    font-family: monospace;
    font-weight: 700;
    color: var(--gray-dark);
}

.col-piece {
    font-weight: 600;
    color: var(--dark);
}

.col-brand, .col-pos {
    color: var(--gray-dark);
    font-size: 0.9rem;
}

.col-price {
    text-align: right;
    padding-right: 15px;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    background-color: var(--gray-light);
    color: var(--gray-dark);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-add {
    background-color: var(--white);
    color: var(--dark);
    border: 1px solid var(--gray-medium);
    border-radius: var(--radius-sm);
    width: 100%;
    padding: 8px 0;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-add.added {
    background-color: #10B981;
    color: white;
    border-color: #10B981;
}

.btn-add:hover:not(.added) {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

/* Order Sidebar (Cart Modal) */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.cart-sidebar {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: min(92vw, 920px);
    max-height: 88vh;
    background-color: var(--white);
    z-index: 1001;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(.4,0,.2,1), opacity 0.28s ease;
}

.cart-sidebar.active {
    transform: translate(-50%, -50%);
    opacity: 1;
    pointer-events: all;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background-color: var(--dark);
    color: var(--white);
}

.cart-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-cart {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
}

.close-cart:hover {
    opacity: 1;
}

.cart-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0;
}

.cart-empty-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-medium);
    text-align: center;
    gap: 16px;
}

.cart-empty-msg i {
    font-size: 3rem;
    color: var(--gray-light);
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-light);
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-code {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--gray-medium);
    margin-bottom: 4px;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--gray-light);
    background-color: var(--white);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--dark);
}

.qty-btn:hover {
    background-color: var(--gray-light);
}

.qty-input {
    width: 40px;
    text-align: center;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    padding: 2px;
    font-family: inherit;
}

.remove-item {
    background: none;
    border: none;
    color: var(--gray-medium);
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
}

.remove-item:hover {
    color: var(--primary-red);
}

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

.cart-summary {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

#cart-total-price-row {
    display: flex !important; /* Force visibility for testing */
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.cart-note {
    font-size: 0.8rem;
    color: var(--gray-dark);
    margin-bottom: 16px;
    text-align: center;
}

.btn-whatsapp {
    background-color: #25D366;
    border-color: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    border-color: #128C7E;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

/* Footer */
.footer {
    background-color: var(--dark);
    color: var(--white);
    padding-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-info .logo {
    justify-content: center; /* Center the logo image */
}

.footer-info p {
    color: #cbd5e1;
    margin-top: 16px;
    max-width: 350px;
}

.footer-contact h3, .footer-links h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-contact h3::after, .footer-links h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-red);
}

.footer-contact ul li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    color: #cbd5e1;
}

.footer-contact ul li i {
    color: var(--primary-red);
    margin-top: 4px;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #cbd5e1;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-red);
    padding-left: 5px;
}

.footer-bottom {
    background-color: #111;
    padding: 20px 0;
    text-align: center;
    color: var(--gray-medium);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    
    .catalog-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .search-box {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }
}

/* Mobile Navigation overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 90;
    opacity: 0;
    transition: var(--transition);
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 0;
        left: -300px;
        width: 300px;
        height: 100vh;
        background-color: var(--white);
        z-index: 95;
        box-shadow: var(--shadow-lg);
        transition: var(--transition);
        padding-top: 80px;
    }

    .main-nav.active-mobile {
        left: 0;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav ul li a {
        display: block;
        padding: 20px;
        border-bottom: 1px solid var(--gray-light);
        font-size: 1.1rem;
    }
    
    .mobile-menu-btn {
        display: block;
        z-index: 100;
    }
    
    .header-container {
        min-height: 85px;
    }

    .logo {
        height: 75px;
    }

    .logo img {
        height: 65px;
    }

    .header-actions {
        margin-right: 15px; /* give space for hamburger */
    }

    .hero h2 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .product-list-header {
        display: none; /* Hide table headers on mobile */
    }
    
    .product-row {
        grid-template-columns: 1fr;
        gap: 12px;
        position: relative;
        padding: 20px;
        border: 1px solid var(--gray-light);
        margin-bottom: 15px;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
    }
    
    .col-code {
        font-size: 1.1rem;
        background: var(--gray-light);
        padding: 4px 8px;
        border-radius: 4px;
        display: inline-block;
        width: max-content;
    }
    
    .col-piece {
        font-size: 1.2rem;
    }
    
    .btn-add {
        margin-top: 10px;
        padding: 12px;
        font-size: 1rem;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .catalog-sidebar {
        grid-template-columns: 1fr;
    }

    /* Mobile Product List Overhaul */
    .product-list-header {
        display: none !important; /* Hide header row on mobile */
    }

    .product-item {
        grid-template-columns: 1fr !important; /* Stack everything vertically */
        gap: 15px;
        padding: 20px !important;
        border: 1px solid var(--gray-light);
        margin: 10px;
        border-radius: 12px;
        box-shadow: var(--shadow-sm);
        position: relative;
    }

    .product-item > div {
        width: 100% !important;
        text-align: left !important;
    }

    .price-col {
        border-top: 1px solid #f1f5f9;
        padding-top: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .price-col::before {
        content: 'PRECIO:';
        font-size: 0.75rem;
        font-weight: 800;
        color: #94a3b8;
    }

    .action-col {
        background: #f8fafc;
        margin: -20px;
        margin-top: 10px;
        padding: 15px 20px;
        border-radius: 0 0 12px 12px;
    }
    
    .action-col .qty-stepper {
        justify-content: center;
    }

    /* Variant Selectors on Mobile */
    .variant-controls {
        gap: 8px;
    }
    
    .attr-selector label {
        margin-bottom: 2px;
    }

    .choice-btn {
        padding: 8px 14px; /* Larger touch targets */
        font-size: 0.9rem;
    }

    /* Filter Bar Adjustments */
    .catalog-controls {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }
    
    .catalog-controls > div:first-child {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    #results-count {
        font-size: 1rem !important;
    }

    .catalog-section .container > div:nth-child(2) > div:first-child {
        flex-direction: column;
    }
    
    .catalog-section .container > div:nth-child(2) > div:first-child > div {
        border-right: none !important;
        border-bottom: 1px solid #e5e7eb;
    }

    /* Search Row */
    .catalog-section .container > div:nth-child(2) > div:nth-child(2) {
        padding: 15px;
    }

    /* Header & Nav */
    .header-container {
        grid-template-columns: auto 1fr auto;
        padding: 0 15px;
    }
    
    .logo img {
        height: 45px;
    }

    .header-actions {
        gap: 10px;
    }

    .cart-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .cart-btn span:not(.cart-badge) {
        display: none; /* Hide text, keep icon and badge */
    }

    .top-bar-left span:first-child,
    .top-bar .divider {
        display: none; /* Hide brand name and dividers on mobile to save height */
    }
    
    .top-bar-left, .top-bar-right {
        gap: 10px;
        justify-content: center;
        width: 100%;
    }
    
    .top-bar {
        padding: 5px 0;
    }

    /* Contact Section Stacking */
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .contact-info-card {
        padding: 25px;
        order: -1; /* Show info first on mobile */
    }
    
    .contact-form-container {
        padding: 25px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ==========================================================================
   Authentication UI (Phase 3)
   ========================================================================== */

/* Header Auth Buttons & User Profile */
.auth-ui {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1100; /* High enough to stay above everything in header */
}

.user-profile {
    position: relative;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.user-profile:hover {
    border-color: var(--gray-medium);
}

.user-email {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 5px; /* Invisible bridge for hover */
    background-color: transparent;
    min-width: 180px;
    z-index: 1000;
}

/* Inner container for actual styling */
.dropdown-inner {
    background-color: var(--white);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-light);
    overflow: hidden;
}

.user-profile:hover .dropdown-content {
    display: block;
}

.dropdown-content button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-content button i {
    margin-right: 8px;
    color: var(--gray-medium);
}

.dropdown-content button:hover {
    background-color: #f8fafc;
    color: var(--primary-red);
}

.dropdown-content button:hover i {
    color: var(--primary-red);
}

/* Authentication Modal */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    z-index: 1900;
    display: none;
    backdrop-filter: blur(2px);
}

.auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 400px;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 2000;
    display: none;
    flex-direction: column;
}

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

.auth-header h2 {
    font-size: 1.25rem;
    color: var(--dark);
    margin: 0;
}

.close-auth {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-medium);
    cursor: pointer;
    transition: var(--transition);
}

.close-auth:hover {
    color: var(--primary-red);
}

.auth-content {
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

.auth-error-msg {
    background-color: #fee2e2;
    color: #ef4444;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid #fca5a5;
    text-align: center;
}

.auth-toggle {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-dark);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-red);
    font-weight: 600;
    cursor: pointer;
    padding: 0 4px;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: var(--transition);
}

.btn-text:hover {
    text-decoration-color: var(--primary-red);
}

/* App Mode - Standalone Code Searcher */
body.is-app-mode .top-bar,
body.is-app-mode .header,
body.is-app-mode .hero-section,
body.is-app-mode .footer,
body.is-app-mode .whatsapp-float {
    display: none !important;
}

body.is-app-mode {
    background-color: var(--white);
}

body.is-app-mode #catalogo {
    padding-top: 20px !important;
}

body.is-app-mode .container {
    max-width: 100%;
    padding: 0 20px;
}
