/* Product Page CSS - Kamasa B2B v2 */

.k-product-page {
    padding: var(--k-spacing-panel, 2rem) 0;
    width: 100%;
    margin-top: 20px;
    background-color: #fff;
}

.k-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   MAIN LAYOUT GRID
   ========================================= */
.k-product-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: start;
    margin-bottom: 4rem;
}

@media (min-width: 992px) {
    .k-product-layout {
        /* Desktop: Gallery 45% - Info 55% */
        grid-template-columns: 45% 55%;
        gap: 4rem;
    }
}

/* =========================================
   LEFT COLUMN: GALLERY
   ========================================= */
.k-layout-col-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.k-product-gallery {
    background: #fff;
    border: 1px solid var(--k-border-soft, #e1e4e8);
    border-radius: var(--k-radius-card, 12px);
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 450px;
    position: relative;
    box-shadow: var(--k-shadow-card, 0 4px 6px rgba(0, 0, 0, 0.05));
}

/* Brand Overlay - Top Left */
.k-product-brand-overlay {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 10;
    background: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.k-product-brand-overlay img {
    height: 45px;
    width: auto;
    display: block;
    object-fit: contain;
}

.k-main-image img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 400px;
    transition: transform 0.3s ease;
}

.k-main-image img:hover {
    transform: scale(1.02);
}

/* =========================================
   RIGHT COLUMN: INFO
   ========================================= */
.k-layout-col-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Top Bar: SKU Badge */
.k-product-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: -0.5rem;
}

.k-sku-floating {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--k-color-muted, #6d6f7a);
    background: #f1f3f5;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Title */
.k-product-title {
    font-family: var(--k-font-heading, "Be Vietnam Pro", sans-serif);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--k-color-secondary, #1f2332);
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.5px;
}

.k-product-line-badge {
    display: inline-block;
    background: var(--k-color-secondary, #1f2332);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    align-self: flex-start;
    text-transform: uppercase;
}

/* Descriptions */
.k-product-short-desc {
    font-size: 1.1rem;
    color: var(--k-color-text, #1b1b1f);
    line-height: 1.6;
    font-weight: 500;
    border-left: 3px solid var(--k-color-accent, #ff9c3c);
    padding-left: 1rem;
}

.k-product-long-desc {
    font-size: 0.95rem;
    color: var(--k-color-muted, #6d6f7a);
    line-height: 1.6;
}

/* =========================================
   PRICING & ACTIONS BOX
   ========================================= */
.k-product-pricing-box {
    background: #ffffff;
    padding: 2rem;
    border: 1px solid var(--k-border-soft, #ebebeb);
    border-radius: var(--k-radius-card, 12px);
    margin-top: 1rem;
    box-shadow: var(--k-shadow-card, 0 10px 25px rgba(0, 0, 0, 0.05));
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.k-stock-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 99px;
    text-transform: uppercase;
    align-self: flex-start;
}

.k-stock-status.disponible {
    background: #e6fffa;
    color: #047481;
}

.k-stock-status.stock-limitado {
    background: #fffbea;
    color: #b7791f;
}

.k-stock-status.bajo-pedido {
    background: #f7f7f7;
    /* Removed pink #fff5f5 */
    color: #c53030;
    border: 1px solid #e2e8f0;
}

.k-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Pricing */
.k-price-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 1.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.k-price-main {
    font-size: 2rem;
    font-weight: 800;
    color: #000000;
    line-height: 1;
    letter-spacing: -0.5px;
}

.k-price-row .k-price--base {
    text-decoration: line-through !important;
    text-decoration-color: #fdb913 !important;
    text-decoration-thickness: 2px !important;
}

.k-tax-note {
    font-size: 0.9rem;
    color: var(--k-color-muted, #999);
    font-weight: 500;
    margin-bottom: 6px;
    text-align: center;
    display: block;
}

/* Buttons */
.k-action-row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* More breath between action buttons */
}

.k-action-row--qty {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

/* Quantity Input */
.k-qty-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--k-border-soft, #ebebeb);
    border-radius: var(--k-radius-pill, 999px);
    overflow: hidden;
    height: 50px;
    /* Match button height approx */
    background: #f7f7f7;
}

.k-qty-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 100%;
    font-size: 1.2rem;
    color: var(--k-color-secondary, #1f2332);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.k-qty-btn:hover {
    background: #e2e8f0;
    color: var(--k-color-primary, #e62e39);
}

.k-qty-input {
    width: 50px;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--k-color-secondary, #1f2332);
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Hide spinners */
.k-qty-input::-webkit-outer-spin-button,
.k-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.k-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: var(--k-radius-pill, 999px);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-family: inherit;
    border: none;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    gap: 0.5rem;
    flex: 1;
    box-sizing: border-box;
    /* Take remaining space in row */
}

.k-btn-primary {
    background: #000000;
    color: #FDD106;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.k-btn-primary:hover {
    background-color: #333333;
    color: #FDD106;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.k-btn-secondary {
    background-color: var(--k-color-secondary, #1f2332);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.k-btn-secondary:hover {
    background-color: #3e4459;
    transform: translateY(-2px);
}

.k-btn-lg {
    width: 100%;
}

.k-btn--whatsapp {
    background-color: #25D366;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.k-btn--whatsapp:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
}

/* Comparator Button */
.k-comparator-action {
    margin-top: 0.5rem;
    text-align: center;
}

.k-btn-compare {
    background: none;
    border: none;
    color: var(--k-color-muted, #666);
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 4px;
}

.k-btn-compare:hover {
    color: var(--k-color-primary, #e62e39);
    background: #f7f7f7;
    /* Removed pink #fff5f5 */
}

.k-btn-compare.is-selected {
    color: var(--k-color-primary, #e62e39);
}

.k-btn-compare .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 6px;
}


/* =========================================
   BOTTOM SECTIONS (ACCORDION)
   ========================================= */
.k-product-bottom-sections {
    margin-top: 5rem;
}

.k-product-accordion {
    border-top: 1px solid var(--k-border-soft, #e2e8f0);
}

.k-accordion-item {
    border-bottom: 1px solid var(--k-border-soft, #e2e8f0);
    margin-bottom: 20px; /* More space between buttons */
}

.k-accordion-header {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem 0; /* Slightly tighter header to focus on 3D spacing */
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.k-accordion-header:hover .k-acc-title {
    color: #FDD106;
    /* Yellow hover */
}

.k-acc-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--k-color-secondary, #1f2332);
    font-family: var(--k-font-heading);
}

.k-acc-icon {
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: #f7fafc;
    color: #a0aec0;
    transition: all 0.2s;
}

.k-accordion-item.open .k-acc-icon {
    background: #FDD106;
    /* Yellow */
    color: #000000;
    /* Black */
    transform: rotate(180deg);
}

.k-accordion-body {
    display: none;
    padding: 2.5rem 0 3rem; /* More air between header and content, and at bottom */
}

.k-acc-content {
    color: var(--k-color-muted, #6d6f7a);
    line-height: 1.7;
    font-size: 1rem;
}

/* Specs Table */
.k-specs-table {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .k-specs-table {
        grid-template-columns: 1fr 1fr;
        /* Two columns */
        border: none;
        /* Borders handled by cells/rows */
        gap: 1rem;
    }
}

.k-spec-row {
    display: grid;
    grid-template-columns: 1fr;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #edf2f7;
    background-color: #f8f9fa;
    /* Default bg */
}

@media (min-width: 768px) {
    .k-spec-row {
        grid-template-columns: 40% 60%;
        /* Label | Value */
        border: 1px solid #edf2f7;
        border-radius: 6px;
    }
}

.k-spec-row:last-child {
    border-bottom: none;
}

.k-spec-row:nth-child(odd) {
    background-color: #f8f9fa;
}

.k-spec-label {
    font-weight: 700;
    color: var(--k-color-secondary, #1f2332);
}

.k-spec-value {
    color: var(--k-color-text, #4a5568);
}

/* Datasheet */
.k-datasheet-wrapper {
    margin-top: 1rem;
}

.k-btn-outline {
    background: transparent;
    border: 2px solid #e1e4e8;
    color: var(--k-color-secondary, #1f2332);
    width: 100%;
    padding: 0.8rem 1.5rem;
    border-radius: var(--k-radius-pill, 99px);
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}

.k-btn-outline:hover {
    border-color: #000;
    color: #FDD106;
    background: #000;
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    .k-product-title {
        font-size: 1.8rem;
    }

    .k-price-main {
        font-size: 2.2rem;
    }

    .k-product-gallery {
        min-height: 350px;
        padding: 1rem;
    }
}

/* Quote Qty Badge (UX Improvement) */
.k-producto-quote-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 20px;
    padding: 6px 16px;
    margin: 10px auto;
    width: fit-content;
    align-self: center;
    transition: all 0.3s ease;
}

.k-producto-quote-qty[data-qty="0"] {
    background: #f5f5f5;
    border-color: #ddd;
    color: #999;
}

.k-producto-quote-qty .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #fdb913;
}

.k-producto-quote-qty[data-qty="0"] .dashicons {
    color: #ccc;
}

/* HARD RESET FOR 3D BUTTONS ON PRODUCT PAGE */
body .k-product-page .kamasa-btn,
body .k-product-page .k-btn-primary.kamasa-btn,
body .k-product-page .k-btn-compare.kamasa-btn,
body .k-product-page .k-accordion-header.kamasa-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    outline: none !important;
}

body .k-product-page .k-accordion-header.kamasa-btn .front {
    background: #ffed00 !important;
}

/* FIX: ENSURE PARENT BORDER AND BACKGROUND DON'T MOUNT ON 3D BUTTON */
.k-product-page .k-btn-compare.kamasa-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    outline: none !important;
}
