/* Scoped Product Card Styles */

/* 1. Global Card Layout */
.k-catalog-card {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Subtle B2B Shadow */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Natural height based on grid */
    position: relative;
    overflow: hidden;
    font-family: 'Myriad Pro', sans-serif !important;
    /* Force Font */
}

.k-catalog-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    /* Elevation on hover */
    transform: translateY(-2px);
    border-color: #ffed00;
    /* Kamasa Yellow Hint */
}

/* 2. Brand Logo Visibility (Critical) */
.k-catalog-card__brand {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    pointer-events: none;
    /* Allow clicking through if needed */
}

.k-catalog-card__brand img {
    height: 40px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
    max-width: 100px;
}

/* 3. Typography & Content */
.k-catalog-card__body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.k-catalog-card__title a {
    font-family: 'Myriad Pro', sans-serif !important;
    font-weight: 700;
    color: #000;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.35;
    margin-bottom: 10px;
    display: block;
}

.k-sku-text {
    font-family: 'Myriad Pro', sans-serif;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

/* 4. Guest View Components */
/* Button: "Solicitar cotización" */
.k-btn--whatsapp {
    background-color: #ffed00;
    /* Kamasa Yellow */
    color: #000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    font-family: 'Myriad Pro', sans-serif !important;
    text-decoration: none;
    margin-top: auto;
    /* Push to bottom */
}

.k-btn--whatsapp:hover {
    background-color: #e6bf00;
    /* Darker Yellow */
    color: #000;
}

.k-btn--whatsapp .k-icon-whatsapp {
    /* Ensure icon color matches text or use specific brand color if SVG */
    filter: brightness(0);
    /* Black icon */
}

/* Info Text: "Regístrate..." */
.k-catalog-card__register-text {
    font-size: 12px;
    color: #000;
    margin-top: 10px;
    text-align: center;
    display: block;
    line-height: 1.4;
    font-family: 'Myriad Pro', sans-serif !important;
}

.k-catalog-card__register-text a {
    color: #000;
    text-decoration: underline;
    font-weight: 600;
}

/* 5. Auth View Components */
.k-price {
    font-family: 'Myriad Pro', sans-serif;
    font-weight: 800;
}

.k-btn--primary {
    background: #000;
    color: #ffed00;
    font-family: 'Myriad Pro', sans-serif;
    font-weight: 700;
    border-radius: 4px;
    padding: 10px;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-top: auto;
}

.k-btn--primary:hover {
    background: #333;
    color: #ffed00;
}

/* 6. Compare Action (Fix) */
.k-btn-compare input[type="checkbox"] {
    display: none;
}

.k-compare-label {
    font-size: 12px;
    color: #666;
    font-family: 'Myriad Pro', sans-serif;
}

/* Modal Implementation (Scoped) */
.k-product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.k-product-modal.k-is-open {
    display: flex;
    opacity: 1;
}

.k-product-modal__content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    font-family: 'Myriad Pro', sans-serif;
}

.k-product-modal.k-is-open .k-product-modal__content {
    transform: translateY(0);
}

.k-product-modal__header {
    border-bottom: 2px solid #ffed00;
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.k-product-modal__title {
    font-size: 18px;
    font-weight: 800;
    color: #000;
    margin: 0;
    text-transform: uppercase;
}

.k-product-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #999;
}

.k-product-modal__actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.k-product-modal__product-name {
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

.k-product-modal__field {
    margin-bottom: 16px;
}

.k-product-modal__label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #555;
}

.k-product-modal__input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.k-product-modal__summary {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 4px;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

.k-product-modal__actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Toast Notification */
.k-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 100000;
    font-size: 0.9rem;
    transform: translateY(100px);
    transition: transform 0.3s ease;
}

.k-toast.k-is-visible {
    transform: translateY(0);
}

.k-toast--success {
    background: #4CAF50;
}

.k-toast--error {
    background: #F44336;
}

.k-toast--info {
    background: #2196F3;
}

.k-toast--warning {
    background: #FF9800;
}

/* =========================================
   ENTERPRISE CARD NORMALIZATION
   Scope: Product Cards ONLY
========================================= */

/* Tarjeta completa */
.k-catalog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* =========================
   IMAGE BLOCK (FIXED HEIGHT)
========================= */
.k-catalog-card__media {
    width: 100%;
    height: 220px !important;
    /* ALTURA FIJA OBLIGATORIA */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
    position: relative;
    padding: 8px 20px !important;
    box-sizing: border-box;
}

/* Fix for the anchor tag wrapping the image */
.k-card-img-link {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
}

/* Imagen */
.k-catalog-card__media img,
.k-card-img-link img,
.k-catalog-card__image {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Caso sin imagen (Placeholder) */
.k-catalog-card__media:empty::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-color: #f9f9f9;
}

/* =========================
   CONTENT BLOCK
========================= */
.k-catalog-card__body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Empujar botones hacia abajo */
.k-catalog-card__actions {
    margin-top: auto;
    position: relative;
    z-index: 50;
    /* HARD FIX: Ensure clickable */
}

/* =========================
   COMPARE BUTTON STATE
========================= */
.k-btn-compare.is-selected {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
}

.k-btn-compare.is-selected .dashicons {
    color: #ffed00 !important;
    /* Kamasa Yellow */
}

.k-btn-compare.is-selected:hover {
    opacity: 0.9;
}

/* =========================
   STOCK VISIBILITY
   ========================= */
.k-catalog-card--no-stock {
    opacity: 0.45;
    filter: grayscale(100%);
    pointer-events: auto;
}