/* FAMATECONS - Premium Industrial Theme */
:root {
    --primary: #fb4500; /* Industrial Orange */
    --primary-dark: #d83b00;
    --secondary: #34495e; /* Deep Blue/Gray */
    --dark: #1a1a1a;
    --darker: #111;
    --light: #f8f9fa;
    --white: #ffffff;
    --gray: #7f8c8d;
    --border: #e0e0e0;
    --font-main: 'Inter', 'Segoe UI', sans-serif;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

/* Base Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-main); color: #333; background-color: var(--light); line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }

/* Container */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--dark); line-height: 1.2; }
.section-title { font-size: 2em; text-align: center; margin-bottom: 40px; text-transform: uppercase; letter-spacing: 1px; position: relative; padding-bottom: 15px; }
.section-title::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 3px; background: var(--primary); }

/* Buttons */
.btn { display: inline-block; padding: 12px 24px; font-weight: 600; text-align: center; cursor: pointer; border: none; border-radius: 4px; transition: var(--transition); text-transform: uppercase; font-size: 0.9em; letter-spacing: 0.5px; }
.btn-primary { background: var(--primary); color: var(--darker); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--darker); }
.btn-whatsapp { background: #25D366; color: white; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.1em; }
.btn-whatsapp:hover { background: #1ebe57; transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Header */
.top-bar { background: var(--darker); color: var(--white); font-size: 0.85em; padding: 8px 0; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar-links a { margin-left: 15px; color: var(--gray); }
.top-bar-links a:hover { color: var(--primary); }

.main-header { background: var(--white); box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 1000; }
.main-header .container { display: flex; justify-content: space-between; align-items: center; padding: 20px; }
.main-nav ul { list-style: none; display: flex; gap: 30px; margin: 0; }
.main-nav ul li a { font-weight: 600; text-transform: uppercase; font-size: 0.9em; position: relative; padding: 5px 0; color: var(--dark); transition: var(--transition); }
.main-nav ul li a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--primary); transition: var(--transition); }
.main-nav ul li a:hover::after, .main-nav ul li a.active::after { width: 100%; }
.main-nav ul li a:hover, .main-nav ul li a.active { color: var(--primary); }

/* Hero Section */
.hero { background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1504917595217-d4dc5ebe6122?auto=format&fit=crop&q=80'); background-size: cover; background-position: center; color: var(--white); padding: 120px 0; text-align: center; }
.hero h1 { font-size: 3.5em; color: var(--white); margin-bottom: 20px; text-transform: uppercase; letter-spacing: 2px; }
.hero p { font-size: 1.2em; color: #ccc; margin-bottom: 30px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px; }
.product-card { background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.03); transition: all 0.4s ease; position: relative; display: flex; flex-direction: column; border: 1px solid rgba(0,0,0,0.05); }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.08); }
.product-image { width: 100%; height: 260px; overflow: hidden; background: #fcfcfc; position: relative; display: flex; align-items: center; justify-content: center; }
.product-image img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); padding: 30px; mix-blend-mode: multiply; }
.product-card:hover .product-image img { transform: scale(1.08); }
.product-badges { position: absolute; top: 15px; left: 15px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.badge { padding: 5px 12px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; border-radius: 20px; color: white; letter-spacing: 0.5px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.badge-new { background: var(--secondary); }
.badge-featured { background: var(--primary); color: white; }
.product-info { padding: 25px 20px; display: flex; flex-direction: column; flex-grow: 1; background: var(--white); z-index: 1; }
.product-category { font-size: 0.75rem; color: var(--gray); text-transform: uppercase; margin-bottom: 8px; letter-spacing: 1px; font-weight: 600; }
.product-title { font-size: 1.1rem; margin-bottom: 15px; color: var(--dark); flex-grow: 1; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.product-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; }
.price-current { font-size: 1.4rem; font-weight: 800; color: var(--primary-dark); }
.price-old { font-size: 0.9rem; text-decoration: line-through; color: var(--gray); }
.product-card .btn { width: 100%; border-radius: 8px; font-weight: 600; padding: 12px; background: transparent; color: var(--primary); border: 2px solid var(--primary); transition: all 0.3s ease; }
.product-card:hover .btn { background: var(--primary); color: white; }

/* Categories Grid */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.category-card { background: var(--white); padding: 30px 20px; text-align: center; border-radius: 8px; box-shadow: var(--shadow-sm); transition: var(--transition); border-bottom: 3px solid transparent; }
.category-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.category-card i { font-size: 2.5em; color: var(--primary); margin-bottom: 15px; }
.category-card h3 { font-size: 1.1em; margin-bottom: 0; }

/* Product Details */
.product-detail-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin-top: 40px; margin-bottom: 60px; background: var(--white); padding: 40px; border-radius: 8px; box-shadow: var(--shadow-sm); }
.product-gallery { position: relative; }
.main-img-container { height: 400px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 15px; padding: 20px; display: flex; align-items: center; justify-content: center; }
.main-img-container img { max-height: 100%; max-width: 100%; object-fit: contain; }
.thumbnails { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.thumb { width: 80px; height: 80px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; padding: 5px; opacity: 0.6; transition: 0.2s; }
.thumb:hover, .thumb.active { opacity: 1; border-color: var(--primary); }

.product-meta h1 { font-size: 2.2em; margin-bottom: 10px; }
.sku-brand { display: flex; gap: 20px; color: var(--gray); font-size: 0.9em; margin-bottom: 20px; }
.sku-brand span { display: flex; align-items: center; gap: 5px; }
.price-block { margin-bottom: 25px; padding: 15px; background: var(--light); border-radius: 8px; }
.stock-status { margin-bottom: 25px; font-weight: 600; }
.in-stock { color: #27ae60; }
.out-stock { color: #e74c3c; }
.short-desc { margin-bottom: 30px; font-size: 1.05em; color: #555; }
.action-buttons { display: flex; flex-direction: column; gap: 15px; margin-bottom: 30px; }

/* Product Tabs */
.product-tabs { margin-top: 50px; }
.tab-headers { display: flex; gap: 10px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn { padding: 10px 20px; background: transparent; border: none; font-size: 1.1em; font-weight: 600; cursor: pointer; color: var(--gray); border-bottom: 3px solid transparent; transition: 0.3s; }
.tab-btn.active { color: var(--dark); border-color: var(--primary); }
.tab-content { display: none; padding: 20px 0; }
.tab-content.active { display: block; }
.specs-list { list-style: none; padding: 0; }
.specs-list li { padding: 10px; border-bottom: 1px solid var(--light); display: flex; }
.specs-list li::before { content: '\f0da'; font-family: 'Font Awesome 5 Free'; font-weight: 900; color: var(--primary); margin-right: 10px; }

/* Footer */
.main-footer { background: var(--darker); color: #ccc; padding: 60px 0 20px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h3 { color: var(--white); margin-bottom: 20px; font-size: 1.2em; position: relative; padding-bottom: 10px; }
.footer-col h3::after { content: ''; position: absolute; bottom: 0; left: 0; width: 40px; height: 2px; background: var(--primary); }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a:hover { color: var(--primary); padding-left: 5px; }
.social-links { display: flex; gap: 15px; margin-top: 20px; }
.social-links a { display: inline-flex; width: 40px; height: 40px; background: rgba(255,255,255,0.1); align-items: center; justify-content: center; border-radius: 50%; color: var(--white); transition: 0.3s; }
.social-links a:hover { background: var(--primary); transform: translateY(-3px); }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.9em; }

/* Layout utility classes added for header */
.top-bar-container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.top-bar-left { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.top-bar-right { display: flex; gap: 15px; font-size: 1.2em; align-items: center; }

.header-container { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; position: relative; }
.main-nav { flex-grow: 1; display: flex; justify-content: center; }
.mobile-menu-btn { display: none; background: transparent; border: none; font-size: 1.8em; color: var(--dark); cursor: pointer; }

/* Grid Utilities */
.grid-2-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.grid-2-cols-form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* Responsive */
@media (max-width: 768px) {
    .product-detail-wrapper { grid-template-columns: 1fr; gap: 30px; padding: 20px; }
    
    .grid-2-cols, .grid-2-cols-form { grid-template-columns: 1fr; gap: 20px; }
    
    .hero { padding: 80px 0; }
    .hero h1 { font-size: 2.2em; }
    .hero p { font-size: 1em; }
    
    /* Top Bar Mobile */
    .top-bar-container { flex-direction: column; gap: 10px; text-align: center; }
    .top-bar-left { justify-content: center; gap: 10px; font-size: 0.9em; }
    .top-bar-right { justify-content: center; margin-top: 5px; }
    
    /* Header Mobile */
    .header-container { padding: 15px 0; }
    .mobile-menu-btn { display: block; }
    .header-actions { display: none; /* Hide Cotizar button on mobile to save space, usually put in menu but leaving out for simplicity */ }
    
    .main-nav { 
        display: none; 
        position: absolute; 
        top: 100%; 
        left: 0; 
        width: 100%; 
        background: var(--white); 
        box-shadow: var(--shadow-md); 
        flex-direction: column; 
        padding: 20px 0;
        z-index: 1000;
        border-top: 1px solid var(--border);
    }
    .main-nav.active { display: flex; }
    .main-nav ul { flex-direction: column; gap: 15px; align-items: center; }
    .main-nav ul li a::after { display: none; }
    
    /* Footer Mobile */
    .footer-grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
    .footer-col h3::after { left: 50%; transform: translateX(-50%); }
    .social-links { justify-content: center; }
}

/* Fix for iOS Safari adding a giant play button over background videos that fail to autoplay */
video::-webkit-media-controls {
    display: none !important;
}
video::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none;
}

/* Floating WhatsApp Widget */
.wa-widget-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.wa-widget-container.active .wa-widget-btn {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.wa-widget-btn {
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2em;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    border: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wa-widget-btn:hover {
    transform: scale(1.1);
}

.wa-widget-box {
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    margin-bottom: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.wa-widget-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.wa-widget-header {
    background: #075E54;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wa-widget-body {
    background: #e5ddd5;
    padding: 15px;
    height: 250px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.wa-message-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.wa-message-row.user {
    flex-direction: row-reverse;
}

.wa-message-bubble {
    background: white;
    padding: 10px 14px;
    border-radius: 12px 12px 12px 0;
    font-size: 0.9em;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    max-width: 85%;
    position: relative;
    line-height: 1.4;
}

.wa-message-row.user .wa-message-bubble {
    background: #dcf8c6;
    border-radius: 12px 12px 0 12px;
}

.wa-message-bubble::before {
    content: '';
    position: absolute;
    bottom: 0;
    border: 8px solid transparent;
}

.wa-message-row.bot .wa-message-bubble::before {
    left: -8px;
    border-right-color: white;
    border-bottom-color: white;
}

.wa-message-row.user .wa-message-bubble::before {
    right: -8px;
    border-left-color: #dcf8c6;
    border-bottom-color: #dcf8c6;
}

.wa-message-time {
    display: block;
    text-align: right;
    font-size: 0.7em;
    color: #999;
    margin-top: 4px;
}

.wa-widget-footer {
    display: flex;
    padding: 12px;
    background: #f0f0f0;
    gap: 10px;
    border-radius: 0 0 12px 12px;
}

#wa-widget-input {
    flex: 1;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    font-size: 0.95em;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

#wa-widget-send {
    background: #25D366;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    transition: background 0.2s;
}

#wa-widget-send:hover {
    background: #1da851;
}

@media (max-width: 480px) {
    .wa-widget-box {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        margin-bottom: 0;
        border-radius: 12px 12px 0 0;
    }
}
