/**
 * KC Product Page — keycode.cloud design
 * Inter · #4361ee · sharp corners (border-radius: 0)
 */

/* Hide breadcrumb, product meta and upsells/related on product pages */
.woocommerce-breadcrumb,
.single-product-category,
.product_meta,
.ast-breadcrumbs-wrapper,
.up-sells,
.related {
    display: none !important;
}

/* ── Box-sizing reset for all kcp elements ── */
.kcp-proof-pills, .kcp-proof-pills *,
.kcp-tp-rating, .kcp-tp-rating *,
.kcp-trust-badges, .kcp-trust-badges *,
.kcp-cart-row, .kcp-cart-row *,
.kcp-qty-wrap, .kcp-qty-wrap *,
.kcp-buy-now-btn,
.kcp-upsell-panel, .kcp-upsell-panel *,
.kcp-payment-badges, .kcp-payment-badges *,
.kcp-reviews, .kcp-reviews * {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════════════
   Social proof pills
   ═══════════════════════════════════════════════════════════════════ */

.kcp-proof-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.kcp-proof-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 0;
    line-height: 1.4;
    letter-spacing: .1px;
}
.kcp-proof-pill svg { flex-shrink: 0; }

.kcp-proof-pill--blue {
    background: rgba(67,97,238,.09);
    color: #4361ee;
    border: 1px solid rgba(67,97,238,.2);
}
.kcp-proof-pill--green {
    background: rgba(16,185,129,.09);
    color: #059669;
    border: 1px solid rgba(16,185,129,.2);
}
.kcp-proof-pill--yellow {
    background: rgba(245,158,11,.1);
    color: #b45309;
    border: 1px solid rgba(245,158,11,.22);
}

/* ═══════════════════════════════════════════════════════════════════
   Trustpilot verified badge
   ═══════════════════════════════════════════════════════════════════ */

.kcp-tp-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    color: inherit;
    margin-bottom: 14px;
    padding: 6px 12px 6px 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    transition: border-color .2s;
}
.kcp-tp-badge:hover { border-color: #00b67a; }

.kcp-tp-badge__logo {
    display: flex;
    align-items: center;
    gap: 6px;
}
.kcp-tp-badge__wordmark {
    font-size: 14px;
    font-weight: 700;
    color: #0f0f1a;
    letter-spacing: -.01em;
}
.kcp-tp-badge__sep {
    width: 1px;
    height: 14px;
    background: #e5e7eb;
    flex-shrink: 0;
}
.kcp-tp-badge__verified {
    font-size: 12px;
    font-weight: 600;
    color: #059669;
}

/* ═══════════════════════════════════════════════════════════════════
   Trust badges 2-column grid
   ═══════════════════════════════════════════════════════════════════ */

.kcp-trust-badges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 14px 0;
}

.kcp-trust-badge {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
    background: #f8f9fc;
    border: 1px solid #eef0f4;
    border-radius: 0;
}

.kcp-trust-badge__icon { flex-shrink: 0; margin-top: 1px; }

.kcp-trust-badge__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.kcp-trust-badge__title {
    font-size: 12px;
    font-weight: 700;
    color: #0f0f1a;
    line-height: 1.3;
}
.kcp-trust-badge__sub {
    font-size: 11px;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.35;
}

/* Hide Astra/theme quantity stepper buttons — we render our own */
.quantity a.plus,
.quantity a.minus,
.kcp-qty-wrap ~ .plus,
.kcp-qty-wrap ~ .minus,
.kcp-qty-wrap ~ .screen-reader-text {
    display: none !important;
}

/* Strip Astra/WC sizing from the .quantity wrapper so our stepper
   is the only thing that sets the width */
form.cart .quantity {
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    float: none !important;
}

/* Force the WooCommerce add-to-cart form to stack vertically so
   payment badges always appear on their own line below the button */
form.cart {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 0 !important;
}
form.cart .kcp-cart-row,
form.cart .kcp-upsell-panel,
form.cart > button.single_add_to_cart_button,
form.cart .kcp-payment-badges {
    flex: 0 0 100%;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   Cart row — quantity + buy-now in a flex row
   ═══════════════════════════════════════════════════════════════════ */

.kcp-cart-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
}

.kcp-upsell-row-label {
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    padding: 8px 0;
    flex: 1;
}

.kcp-hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   Quantity stepper
   ═══════════════════════════════════════════════════════════════════ */

.kcp-qty-wrap {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    flex-shrink: 0;
    width: auto !important;
}

.kcp-qty-btn {
    width: 36px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fc;
    border: none;
    cursor: pointer;
    color: #374151;
    transition: background .2s, color .2s;
    padding: 0;
    flex-shrink: 0;
}
.kcp-qty-btn:hover:not(:disabled) { background: #eef2ff; color: #4361ee; }
.kcp-qty-btn:disabled { opacity: .35; cursor: not-allowed; }

.kcp-qty-wrap input.qty {
    width: 44px !important;
    height: 44px !important;
    text-align: center;
    border: none !important;
    border-left: 1px solid #e5e7eb !important;
    border-right: 1px solid #e5e7eb !important;
    font-size: 15px;
    font-weight: 600;
    color: #0f0f1a;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    -moz-appearance: textfield;
    font-family: inherit;
    line-height: 44px;
    min-width: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.kcp-qty-wrap input.qty::-webkit-outer-spin-button,
.kcp-qty-wrap input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   Buy Now button
   ═══════════════════════════════════════════════════════════════════ */

.kcp-buy-now-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    height: 44px;
    background: #4361ee;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 4px 16px rgba(67,97,238,.25);
    flex: 1;
    white-space: nowrap;
    letter-spacing: -.01em;
    text-decoration: none !important;
}
.kcp-buy-now-btn:hover {
    background: #3651d4;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(67,97,238,.35);
    color: #fff !important;
}
.kcp-buy-now-btn svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════
   Upsell panel
   ═══════════════════════════════════════════════════════════════════ */

.kcp-upsell-panel {
    overflow: hidden;
    max-height: 0;
    transition: max-height .4s cubic-bezier(.4,0,.2,1), margin .3s;
    margin-bottom: 0;
}
.kcp-upsell-panel--open {
    max-height: 800px;
    margin-bottom: 12px;
}

.kcp-upsell-inner {
    padding: 14px;
    background: #f8f9fc;
    border: 1px solid #e5e7eb;
    border-radius: 0;
}

.kcp-upsell-cards {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 12px;
}

/* ── Upsell card ── */

.kcp-upsell-card {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 0;
    padding: 14px 14px 12px;
    position: relative;
    transition: border-color .2s, box-shadow .2s;
}
.kcp-upsell-card--featured {
    border-color: rgba(67,97,238,.4);
}
.kcp-upsell-card--selected {
    border-color: #4361ee !important;
    box-shadow: 0 0 0 3px rgba(67,97,238,.1);
}

.kcp-upsell-card__badge {
    position: absolute;
    top: -11px;
    left: 12px;
    background: #4361ee;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    letter-spacing: .5px;
    text-transform: uppercase;
    border-radius: 0;
}

.kcp-upsell-card__title {
    font-size: 13px;
    font-weight: 700;
    color: #0f0f1a;
    margin-bottom: 8px;
    /* Reserve same top space on every card so titles always align,
       even on non-featured cards that have no badge */
    padding-top: 22px;
}

.kcp-upsell-card__items {
    list-style: none;
    padding: 0;
    margin: 0 0 10px;
}
.kcp-upsell-card__item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    margin-bottom: 3px;
    line-height: 1.4;
}
.kcp-upsell-card__item-icon {
    flex-shrink: 0;
    font-size: 11px;
    width: 14px;
    text-align: center;
    font-weight: 700;
}
.kcp-upsell-card__item--included         { color: #0f0f1a; }
.kcp-upsell-card__item--included .kcp-upsell-card__item-icon { color: #10b981; }
.kcp-upsell-card__item--excluded         { color: #9ca3af; }
.kcp-upsell-card__item-qty {
    color: #6b7280;
    font-size: 11px;
    margin-left: 2px;
}

/* ── Card footer: price + select button ── */

.kcp-upsell-card__footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f4;
    margin-top: auto;
}

.kcp-upsell-card__price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
}
.kcp-upsell-card__price-main {
    font-size: 18px;
    font-weight: 800;
    color: #0f0f1a;
    letter-spacing: -.02em;
}
.kcp-upsell-card__price-original {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: line-through;
}
.kcp-upsell-card__discount {
    font-size: 11px;
    font-weight: 700;
    color: #059669;
    background: rgba(16,185,129,.1);
    padding: 2px 5px;
    border-radius: 0;
}

.kcp-upsell-card__select {
    width: 100%;
    padding: 9px 14px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
    font-family: inherit;
}
.kcp-upsell-card__select:hover {
    background: #eef2ff;
    color: #4361ee;
    border-color: #c7d0f9;
}
.kcp-upsell-card--selected .kcp-upsell-card__select {
    background: #4361ee;
    color: #fff;
    border-color: #4361ee;
}

/* ── Confirm / continue button ── */

.kcp-upsell-confirm {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: #4361ee;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background .2s;
    box-shadow: 0 4px 16px rgba(67,97,238,.25);
    font-family: inherit;
    letter-spacing: -.01em;
}
.kcp-upsell-confirm:hover { background: #3651d4; }
.kcp-upsell-confirm--hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   Payment badges
   ═══════════════════════════════════════════════════════════════════ */

.kcp-payment-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 12px;
    font-size: 12px;
    color: #6b7280;
    width: 100%;
    clear: both;
    flex-basis: 100%;
}
.kcp-payment-badges__label {
    font-weight: 600;
    color: #9ca3af;
    margin-right: 2px;
}
.kcp-payment-badge {
    padding: 3px 8px;
    background: #f8f9fc;
    border: 1px solid #eef0f4;
    border-radius: 0;
    font-size: 11px;
    font-weight: 500;
    color: #374151;
}
.kcp-payment-badge--ssl {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16,185,129,.07);
    border-color: rgba(16,185,129,.2);
    color: #059669;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════
   Reviews section
   ═══════════════════════════════════════════════════════════════════ */

.kcp-reviews {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    padding: 56px 24px;
    border-top: 1px solid #eef0f4;
    max-width: 1200px;
    margin: 0 auto;
    /* Span full width inside the WooCommerce .product flex container */
    flex: 0 0 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Summary column — store info card */
.kcp-reviews__summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: #f8f9fc;
    border: 1px solid #eef0f4;
    overflow: hidden;
}

/* Logo area */
.kcp-reviews__logo {
    padding: 20px 20px 16px;
    width: 100%;
    border-bottom: 1px solid #eef0f4;
    background: #fff;
}
.kcp-reviews__logo img {
    max-height: 32px;
    width: auto;
    display: block;
}
.kcp-reviews__site-name {
    font-size: 20px;
    font-weight: 900;
    color: #0f0f1a;
    letter-spacing: -.03em;
    line-height: 1;
}
.kcp-reviews__site-name span { color: #4361ee; }

/* Description + email */
.kcp-reviews__body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}
.kcp-reviews__desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.65;
    margin: 0;
}
.kcp-reviews__email {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #4361ee;
    text-decoration: none !important;
    transition: opacity .2s;
    word-break: break-all;
}
.kcp-reviews__email:hover { opacity: .75; }

/* Trustpilot verified badge — pinned to bottom of card */
.kcp-reviews__tp-verified {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    text-decoration: none !important;
    transition: background .2s;
    width: 100%;
    margin-top: auto;
}
.kcp-reviews__tp-verified:hover { background: #f0fdf9; }

.kcp-reviews__tp-verified__logo {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
    color: #0f0f1a;
    letter-spacing: -.01em;
}
.kcp-reviews__tp-verified__label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    padding-left: 27px; /* align with the wordmark, past the star icon */
    white-space: nowrap;
}

/* Cards column */
.kcp-reviews__side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.kcp-reviews__cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Review card — mirrors .kc-review-card from landing page */
.kcp-review-card {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 0;
    padding: 20px 20px 18px;
    transition: all .3s cubic-bezier(.4,0,.2,1);
}
.kcp-review-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
    border-color: #d1d5db;
}
.kcp-review-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 10px;
}
.kcp-review-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.65;
    margin-bottom: 14px;
    font-style: italic;
}
.kcp-review-author {
    display: flex;
    align-items: center;
    gap: 10px;
}
.kcp-review-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #4361ee;
    flex-shrink: 0;
}
.kcp-review-name  { font-size: 13px; font-weight: 700; color: #0f0f1a; }
.kcp-review-label { font-size: 11px; color: #9ca3af; }

/* All reviews link */
.kcp-reviews__all-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #4361ee;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: gap .2s;
}
.kcp-reviews__all-link:hover { gap: 8px; }
.kcp-reviews__all-link svg { color: #4361ee; }

/* ═══════════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .kcp-reviews__cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .kcp-trust-badges { grid-template-columns: 1fr; }
    .kcp-reviews { grid-template-columns: 1fr; gap: 28px; padding: 40px 20px; }
    .kcp-reviews__summary { flex-direction: row; flex-wrap: wrap; }
    .kcp-reviews__logo { width: auto; border-bottom: none; border-right: 1px solid #eef0f4; }
    .kcp-reviews__body { flex: 1; }
    .kcp-reviews__tp-verified { border-top: 1px solid #e5e7eb; width: 100%; }
    .kcp-reviews__cards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .kcp-buy-now-btn { font-size: 13px; padding: 0 14px; }
    .kcp-buy-now-label { display: none; }
    .kcp-reviews { padding: 32px 16px; }
}
