/**
 * Kamasa Product Comparator Styles
 */

/* --- Button on Product Page --- */
.k-comparator-action {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
    display: block;
}

.k-btn-compare {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    /* Visual separation as requested */
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    color: #4a5568;
    background: white;
    padding: 12px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-family: inherit;
    gap: 8px;
    /* For icon spacing */
    margin-bottom: 5px;
}

.k-btn-compare:hover {
    background: #f7fafc;
    border-color: #a0aec0;
    color: #2d3748;
}

.k-btn-compare.active {
    background: #f0fff4;
    /* Light green indication */
    border-color: #48bb78;
    color: #2f855a;
    font-weight: 600;
}



/* Hide the plus icon when active if we want to change content completely */
.k-btn-compare.active .dashicons-plus-alt2 {
    display: none;
}

.k-btn-compare.active::before {
    content: "\f147";
    /* Dashicons 'yes' checkmark */
    font-family: dashicons;
    font-size: 20px;
}

/* --- Catalog / Small Button --- */
.k-btn-compare-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
    background: #f8f9fa;
    border: 1px dashed #e2e8f0;
}

.k-btn-compare-sm .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* --- Comparator Page Layout (Enterprise B2B) --- */
.k-comparator-page {
    padding: 60px 0;
    min-height: 80vh;
    font-family: 'Myriad Pro', 'Segoe UI', Helvetica, Arial, sans-serif;
    background-color: #fff;
    color: #000;
}

/* Header */
.k-comparator-header {
    margin-bottom: 50px;
    text-align: center;
}

.k-comparator-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #000;
    letter-spacing: -0.5px;
}

.k-comparator-header p {
    font-size: 16px;
    color: #666;
    /* Allowed grey for text */
    font-weight: 400;
    margin: 0;
}

/* Container & Table Wrapper */
.k-comparator-table-wrapper {
    overflow-x: auto;
    width: 100%;
    background: #fff;
    /* Clean, no heavy shadows */
    border-top: 1px solid #000;
}

.k-comparator-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Table Cells */
.k-comparator-table th,
.k-comparator-table td {
    padding: 20px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #e5e5e5;
    /* Subtle separator */
    font-size: 14px;
}

/* Column Labels (Left) */
.k-comparator-table th.k-col-label {
    width: 220px;
    background: #f9f9f9;
    font-weight: 700;
    color: #000;
    text-align: left;
    border-right: 1px solid #e5e5e5;
    position: sticky;
    left: 0;
    z-index: 2;
}

/* Product Header Column */
.k-comparator-table thead th {
    vertical-align: top;
    padding-top: 30px;
    background: #fff;
    position: relative;
}

/* Remove Button */
.k-btn-remove-compare {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #000;
    opacity: 0.3;
    cursor: pointer;
    transition: opacity 0.2s;
    padding: 5px;
    z-index: 5;
}

@media (min-width: 769px) {
    .k-comparator-table thead th {
        padding-top: 60px !important; /* Space for the button above the logo */
    }

    .k-btn-remove-compare {
        top: 10px !important;
        right: 50% !important;
        transform: translateX(50%) !important; /* Center it horizontally */
        width: auto !important;
        opacity: 1 !important; /* Make it visible on desktop comparison */
    }
}

.k-btn-remove-compare:hover {
    opacity: 1;
}

/* Logo & Title */
.k-comp-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
    margin: 0 auto 15px;
    display: block;
}

.k-comp-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #000;
    line-height: 1.3;
    margin-bottom: 5px;
}

.k-comp-sku {
    display: block;
    font-size: 13px;
    color: #666;
    font-weight: 400;
}

/* Empty Column */
.k-col-empty {
    background: #fff;
}

.k-comp-empty-cell {
    display: block;
    font-size: 30px;
    color: #e5e5e5;
    margin-bottom: 5px;
    font-weight: 300;
}

.k-col-empty {
    color: #999;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Images */
.k-comp-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.k-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    background: #f9f9f9;
    color: #ccc;
    font-size: 13px;
}

/* Price & Stock Section */
.k-comp-stock {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    border: 1px solid #000;
    color: #000;
    background: transparent;
}

/* Specific stock overrides if strictly needed, but kept monochrome/simple as requested */
.k-comp-stock.disponible {
    border-color: #000;
    color: #000;
    opacity: 0.8;
}

.k-comp-stock.consultar,
.k-comp-stock.agotado {
    border-color: #999;
    color: #999;
}

.k-comp-price {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin-bottom: 15px;
}

/* Actions */
.k-comp-actions {
    margin-top: 10px;
}

.k-comparator-page .k-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
    /* Square/Sharp for enterprise */
}

/* Primary Button (Ver Producto): Kamasa Style (Black/Yellow) */
.k-comparator-page .k-btn-primary {
    background: #000;
    color: #ffed00;
    border: 1px solid #000;
}

.k-comparator-page .k-btn-primary:hover {
    background: #333;
    color: #ffed00;
    border-color: #333;
}

/* Technical Specs */
.k-comp-specs-section td {
    background: #f0f0f0;
    text-align: left;
    padding: 12px 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
    border-bottom: 1px solid #ddd;
}

/* Spec Values */
.k-comparator-table tbody tr:hover td {
    background: #fafafa;
}

.k-spec-empty {
    color: #ccc;
}

/* Downloads */
.k-comparator-page .k-btn-outline {
    background: transparent;
    border: 1px solid #000;
    color: #000;
}

.k-comparator-page .k-btn-outline:hover {
    background: #000;
    color: #fff;
}

.k-comparator-page .k-btn-outline i {
    margin-right: 8px;
}

.k-no-datasheet {
    font-size: 13px;
    color: #999;
    font-style: italic;
}

/* Empty Page State */
.k-comparator-empty {
    text-align: center;
    padding: 80px 20px;
}

.k-comparator-empty p {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .k-comparator-header h1 {
        font-size: 24px;
    }

    .k-comparator-table th.k-col-label {
        width: 140px;
        font-size: 12px;
        padding: 15px 10px;
    }

    .k-comparator-table th,
    .k-comparator-table td {
        padding: 15px 10px;
    }
}

/* ------------------------------------------------------------------
   UI REFINEMENT: SINGLE CHECK FIX (CSS ONLY)
   Solves double check issue and standardizes Visual State (Enterprise V2)
   ------------------------------------------------------------------ */

/* 1. Clean Normal State: Hide default icon, enforce text style */
.k-btn-compare .dashicons {
    display: none !important;
}

.k-btn-compare.kamasa-btn {
    display: block !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.k-btn-compare:hover {
    background: transparent !important;
}

.k-btn-compare .k-compare-label {
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.k-btn-compare .k-compare-label::before {
    content: "+ ";
    margin-right: 2px;
}

/* 2. active/is-selected State: Neutralized for 3D System */
.k-btn-compare.active.kamasa-btn,
.k-btn-compare.is-selected.kamasa-btn {
    background-color: transparent !important;
    border-color: transparent !important;
}

/* 3. The Single Checkmark (via Button Pseudo) - Neutralized for 3D */
.k-btn-compare.active.kamasa-btn::before,
.k-btn-compare.is-selected.kamasa-btn::before {
    display: none !important;
}

/* 4. Text Swap: Hide "Comparar", Show "Comparando" */
.k-btn-compare.active .k-compare-label,
.k-btn-compare.is-selected .k-compare-label {
    font-size: 0 !important;
    display: inline-block;
}

.k-btn-compare.active .k-compare-label::before,
.k-btn-compare.is-selected .k-compare-label::before {
    content: none !important;
}

.k-btn-compare.active .k-compare-label::after,
.k-btn-compare.is-selected .k-compare-label::after {
    content: "COMPARANDO";
    font-size: 11px !important;
    color: #ffed00;
    /* Kamasa Yellow */
    vertical-align: middle;
}

/* ------------------------------------------------------------------
   UI REFINEMENT: STICKY FLOATING BAR (Restored)
   ------------------------------------------------------------------ */
.k-comparator-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    /* Ensure on top of everything */
    background: #fff;
    border-top: 3px solid #ffed00;
    /* Kamasa Yellow */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 15px 0;
    display: none;
    /* JS toggles flex */
    justify-content: center;
    align-items: center;
    animation: kSlideUp 0.3s ease-out;
}

@keyframes kSlideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.k-bar-content {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1280px;
    width: 100%;
    padding: 0 20px;
    justify-content: space-between;
    margin: 0 auto;
}

.k-bar-text {
    font-size: 16px;
    color: #000;
}

.k-btn-view-compare {
    background: #000;
    color: #ffed00;
    border: none;
    padding: 10px 25px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
    transition: background 0.2s;
}

.k-btn-view-compare:hover {
    background: #333;
    color: #ffed00;
}

.k-btn-clear-compare {
    background: transparent;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
}

.k-btn-clear-compare:hover {
    color: #d00;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .k-comparator-bar {
        padding: 10px 0;
    }

    .k-bar-content {
        flex-direction: column;
        gap: 10px;
    }

    .k-btn-view-compare {
        width: 100%;
    }
}

/* HARD RESET FOR 3D BUTTONS - PREVENT DUPLICATION */
body .kamasa-btn,
body button.kamasa-btn,
body a.kamasa-btn,
body .k-btn-compare.kamasa-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    outline: none !important;
}