/* ==========================================================================
   CardNet.ec - Componentes UI de Taller Corporativo (components.css)
   ========================================================================== */

/* 1. Botones Sobrios y Rectangulares (Estilo Editorial Premium) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.75rem;
    border-radius: var(--radius-sm); /* Bordes casi rectos, formales */
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* El botón principal de llamada a la acción ahora es del verde oficial de la marca */
.btn-primary {
    background-color: var(--primary);
    color: var(--light);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(99, 174, 44, 0.2);
}

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

.btn-secondary:hover {
    background-color: var(--surface-light);
    border-color: var(--dark);
}

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

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

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

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

/* 2. Barra de Garantías Corporativas (Con fondo suave del verde de la marca) */
.satisfaction-bar {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    background-color: var(--primary-light); /* Verde translúcido sutil */
}

.satisfaction-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.satisfaction-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-grow: 1;
    justify-content: center;
}

.satisfaction-item strong {
    color: var(--dark);
}

.satisfaction-icon {
    width: 16px;
    height: 16px;
    stroke: var(--primary);
    stroke-width: 2.2;
    fill: none;
    flex-shrink: 0;
}

/* 3. Cuadrícula de Acabados (Con Foco en Grabado Láser) */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .brand-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .brand-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.brand-card {
    background-color: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: var(--transition-fast);
}

.brand-card:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

/* Destacado del Láser */
.brand-card.laser-focus {
    border-color: var(--primary);
    background-color: var(--primary-light);
    position: relative;
    overflow: hidden;
}

.brand-card.laser-focus::before {
    content: 'Principal';
    position: absolute;
    top: 4px;
    right: -24px;
    background-color: var(--primary);
    color: var(--light);
    font-size: 0.52rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 1px 24px;
    transform: rotate(45deg);
    letter-spacing: 0.05em;
}

.brand-card-text {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.brand-card-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* 4. Tarjetas de Artículos Personalizables (Estilo Galería Editorial) */
.product-card {
    background-color: var(--light);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(99, 174, 44, 0.08), 0 5px 15px rgba(0, 0, 0, 0.03);
    transform: translateY(-6px);
}

.product-card-image-wrap {
    position: relative;
    overflow: hidden;
}

.product-card-image-wrap img {
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.product-card:hover .product-card-image-wrap img {
    transform: scale(1.05);
}

/* Efecto reflejo metálico (shine) */
.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: none;
    pointer-events: none;
}

.product-card:hover::after {
    left: 150%;
    transition: left 0.8s ease-in-out;
}

.product-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    border-top: 1px solid var(--border);
    background-color: var(--light);
}

.product-card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
    line-height: 1.3;
}

.product-card-price {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 0.35rem;
}

.product-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.product-card-link {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--dark);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    border-bottom: 1px solid transparent;
}

.product-card-link:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.product-card-link::after {
    content: '→';
    transition: var(--transition-fast);
}

.product-card:hover .product-card-link::after {
    transform: translateX(3px);
}

/* 5. Formularios Corporativos */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--light);
}

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

/* 6. Acordeones Sobrios */
.faq-item {
    border-bottom: 1px solid var(--border);
    background-color: var(--light);
}

.faq-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 1.25rem 0;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--dark);
}

.faq-icon {
    width: 10px;
    height: 10px;
    position: relative;
    color: var(--text-muted);
}

.faq-icon::before, .faq-icon::after {
    content: '';
    position: absolute;
    background-color: currentColor;
    transition: var(--transition-fast);
}

.faq-icon::before {
    top: 4px;
    left: 0;
    width: 10px;
    height: 2px;
}

.faq-icon::after {
    top: 0;
    left: 4px;
    width: 2px;
    height: 10px;
}

.faq-item.active .faq-icon::after {
    transform: rotate(90deg);
    opacity: 0;
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}

.faq-content p {
    padding: 0 0 1.25rem 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 7. Placeholders de Imagen / Renders Finitos */
.image-placeholder {
    width: 100%;
    aspect-ratio: 16/10;
    background-color: var(--surface-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.image-placeholder-inner {
    position: absolute;
    inset: 12px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--light);
    border: 1px solid var(--border);
}

.image-placeholder.theme-green .image-placeholder-inner {
    background-color: var(--surface-light);
}

.image-placeholder.theme-blue .image-placeholder-inner {
    background-color: var(--surface-light);
}

.image-placeholder.theme-gray .image-placeholder-inner {
    background-color: var(--surface-light);
}

.image-placeholder-icon {
    width: 32px;
    height: 32px;
    stroke: var(--text-muted);
    stroke-width: 1.5;
    fill: none;
    margin-bottom: 0.5rem;
}

.image-placeholder-text {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
    text-align: center;
    padding: 0 10px;
}

.image-placeholder-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 8. Botón de WhatsApp Flotante Redondeado */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #25D366;
    color: white;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5);
    color: white;
}

.whatsapp-icon {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

@media (max-width: 767px) {
    .whatsapp-float {
        bottom: 80px; /* Queda elevado sobre la barra móvil para no solaparse */
        right: 18px;
        width: 50px;
        height: 50px;
    }
    .whatsapp-icon {
        width: 26px;
        height: 26px;
    }
}

/* 9. Dropdown de Carrito de Cotización en Cabecera (Minicart) */
.header-cart-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.cart-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition-fast);
    text-decoration: none;
}

.cart-icon-btn:hover {
    background-color: var(--surface-light);
    color: var(--primary);
}

.cart-badge-count, .cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.68rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.minicart-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 1.25rem;
    z-index: 1000;
    text-align: left;
    margin-top: 10px;
    animation: fadeInFast 0.2s ease-out;
}

.header-cart-dropdown-wrapper:hover .minicart-dropdown {
    display: block;
}

.minicart-items {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1rem;
    padding-right: 4px;
}

/* Barra de scroll limpia para minicart */
.minicart-items::-webkit-scrollbar {
    width: 4px;
}
.minicart-items::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 2px;
}

.minicart-item {
    display: flex;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid var(--surface-light);
    padding-bottom: 8px;
}

.minicart-item-img {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: block;
}

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

.minicart-item-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.minicart-item-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.minicart-item-subtotal {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
}

.minicart-total {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.minicart-total-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.minicart-total-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

@keyframes fadeInFast {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ==========================================================================
   Estilos de Panel Lateral (Drawer), Modal de Detalles y Barra Responsive
   ========================================================================== */

/* Overlay de la Lista de Cotización */
.quote-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.quote-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Panel Lateral (Drawer) */
.quote-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: white;
    z-index: 2001;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.quote-drawer.open {
    right: 0;
}

.quote-drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.quote-drawer-header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.3rem;
}
.quote-drawer-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
}

.quote-drawer-body {
    padding: 1.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

.drawer-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.drawer-item-card {
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--surface-light);
    padding-bottom: 10px;
}
.drawer-item-info {
    flex-grow: 1;
}
.drawer-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0 0 2px 0;
}
.drawer-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Modal de Detalle de Producto */
.product-detail-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.product-detail-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.product-detail-modal {
    background: white;
    width: 100%;
    max-width: 580px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    animation: fadeInFast 0.3s ease-out;
}

/* Barra Móvil Inferior */
.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.06);
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 8px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 998;
}

.mobile-bottom-btn-wa {
    padding: 8px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--dark);
    text-transform: none;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-bottom-btn-quote {
    padding: 8px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 6px;
    background: var(--primary);
    border: none;
    color: white;
    text-transform: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (min-width: 768px) {
    .mobile-bottom-bar {
        display: none !important;
    }
}

@media (max-width: 767px) {
    body {
        padding-bottom: 70px !important; /* Espacio de seguridad para evitar que la barra fija tape el pie de página */
    }
    .footer-bottom {
        padding-bottom: 2.5rem !important; /* Margen extra para que el copyright y enlaces respiren */
    }
}
