/* ══════════════════════════════════════════════════════
   KG Product Grid Pro — style.css v1.0
   ══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');

/* ── Base ─────────────────────────────────────────────── */
.kgp-wrap,
.kgp-wrap * {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-sizing: border-box;
}

/* ── Heading ──────────────────────────────────────────── */
.kgp-heading {
    font-size: 28px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0 0 22px;
    letter-spacing: -0.3px;
    line-height: 1.15;
}

/* ── Grid ─────────────────────────────────────────────── */
.kgp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ── Card ─────────────────────────────────────────────── */
.kgp-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #ede8e0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 14px rgba(0,0,0,0.06);
    transition: box-shadow 0.25s ease, transform 0.2s ease;
    position: relative;
    padding: 14px 14px 18px;
}
.kgp-card:hover {
    box-shadow: 0 10px 32px rgba(0,0,0,0.13);
    transform: translateY(-3px);
}
.kgp-card.kgp-active-card {
    z-index: 50;
}

/* ── Image — floats as its own rounded block with a REAL visible border ── */
.kgp-img-wrap {
    display: block;
    position: relative;
    background: #f7f4f0;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 14px;
    border: 2px solid #e8d9c3;
    aspect-ratio: 1 / 1;
    width: 100%;
}
.kgp-img-wrap img {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 2px;
    transition: transform 0.35s ease;
    display: block;
}
.kgp-card:hover .kgp-img-wrap img { transform: scale(1.05); }

/* ── Ribbon ───────────────────────────────────────────── */
.kgp-ribbon {
    position: absolute; top: 14px; left: -2px;
    background: #e63946; color: #fff;
    font-size: 11px; font-weight: 800;
    padding: 5px 16px 5px 10px;
    border-radius: 0 4px 4px 0;
    z-index: 5;
    letter-spacing: 0.2px;
    clip-path: polygon(0 0, 100% 0, 90% 50%, 100% 100%, 0 100%);
    box-shadow: 2px 2px 8px rgba(0,0,0,0.18);
}

/* ── Card body — no extra padding, card itself provides it ── */
.kgp-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    position: relative;
}

/* ── Title ────────────────────────────────────────────── */
.kgp-title {
    font-size: 15px;
    font-weight: 700;
    color: #b5621a;
    line-height: 1.4;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
    letter-spacing: -0.1px;
}
.kgp-title:hover { color: #884a0e; text-decoration: none; }

/* ── Tags ─────────────────────────────────────────────── */
.kgp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.kgp-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 9px;
    border-radius: 30px;
    white-space: nowrap;
    letter-spacing: 0.1px;
}
.kgp-tag-wc {
    background: #e8f4e8 !important;
    color: #2a6b2a !important;
}

/* ── Rating & Views ───────────────────────────────────── */
.kgp-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}
.kgp-star {
    color: #f5a623;
    font-size: 17px;
    line-height: 1;
}
.kgp-rating-val {
    font-size: 14px;
    font-weight: 800;
    color: #222;
}
.kgp-views {
    font-size: 13px;
    font-weight: 600;
    color: #999;
}

/* ════════════════════════════════════════════════════════
   CUSTOM SELECT DROPDOWN
   ════════════════════════════════════════════════════════ */
.kgp-var-row { position: relative; }

.kgp-select {
    position: relative;
    width: 100%;
    user-select: none;
}

/* Trigger row */
.kgp-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 13px;
    background: #fffaf4;
    border: 1.5px solid #d4b896;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    transition: border-color 0.2s, background 0.15s, box-shadow 0.2s;
}
.kgp-select-trigger:hover {
    border-color: #b07030;
    box-shadow: 0 2px 8px rgba(160,98,26,0.12);
}
.kgp-select.open .kgp-select-trigger {
    border-color: #a0621a;
    background: #fff8f0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 2px 8px rgba(160,98,26,0.15);
}

/* Arrow icon */
.kgp-select-arrow {
    display: flex;
    align-items: center;
    color: #a0621a;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.kgp-select.open .kgp-select-arrow { transform: rotate(180deg); }

/* Dropdown panel */
.kgp-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border: 1.5px solid #d4b896;
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 99999;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height 0.3s ease, opacity 0.22s ease, transform 0.22s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.kgp-select.open .kgp-select-dropdown {
    max-height: 240px;
    opacity: 1;
    transform: translateY(0);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d4b896 #fff;
}
.kgp-select.open .kgp-select-dropdown::-webkit-scrollbar       { width: 4px; }
.kgp-select.open .kgp-select-dropdown::-webkit-scrollbar-thumb { background: #d4b896; border-radius: 4px; }

/* Individual option */
.kgp-select-option {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-bottom: 1px solid #faf5ef;
}
.kgp-select-option:last-child { border-bottom: none; }
.kgp-select-option:hover   { background: #fff5eb; color: #a0621a; }
.kgp-select-option.selected { background: #fff0dc; color: #a0621a; font-weight: 700; }
.kgp-placeholder { color: #bbb; font-style: italic; font-weight: 500; }

/* ── Price — BIG, BOLD, PROMINENT ────────────────────── */
.kgp-price {
    font-size: 21px;
    font-weight: 900;
    color: #1a1a1a;
    letter-spacing: -0.4px;
    line-height: 1.2;
    margin: 2px 0;
}
.kgp-price del {
    font-size: 13px;
    font-weight: 500;
    color: #bbb;
    text-decoration: line-through;
    margin-left: 5px;
    vertical-align: middle;
}
.kgp-price ins { text-decoration: none; }
.kgp-price .woocommerce-Price-amount      { color: inherit; font-size: inherit; font-weight: inherit; }
.kgp-price ins .woocommerce-Price-amount  { color: inherit; }
.kgp-price del .woocommerce-Price-amount  { color: #bbb !important; font-size: 13px !important; font-weight: 500 !important; }

/* ── Add to Cart Button ───────────────────────────────── */
.kgp-btn {
    display: block;
    width: 100%;
    padding: 12px 0;
    margin-top: auto;
    background: #a0621a;
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.kgp-btn:hover:not(.kgp-oos) {
    background: #7a4a10;
    box-shadow: 0 4px 14px rgba(160,98,26,0.35);
}
.kgp-btn:active:not(.kgp-oos) { transform: scale(0.98); }
.kgp-btn.kgp-oos {
    background: #e8e8e8;
    color: #aaa;
    cursor: not-allowed;
    letter-spacing: 1px;
}
.kgp-btn.kgp-loading { opacity: 0.7; cursor: wait; }
.kgp-btn.kgp-added   { background: #2a6b2a !important; letter-spacing: 0.5px; }

/* ── Footer / View More ───────────────────────────────── */
.kgp-footer {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}
.kgp-viewmore {
    display: inline-block;
    padding: 12px 40px;
    border: 2px solid #a0621a;
    color: #a0621a;
    background: transparent;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.kgp-viewmore:hover {
    background: #a0621a;
    color: #fff;
    box-shadow: 0 4px 16px rgba(160,98,26,0.3);
    text-decoration: none;
}

/* ── Toast ────────────────────────────────────────────── */
#kgp-toast {
    position: fixed; bottom: 24px; right: 24px;
    background: #1a1a1a; color: #fff;
    padding: 13px 22px; border-radius: 10px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px; font-weight: 700;
    z-index: 999999; opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none; max-width: 300px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
#kgp-toast.show    { opacity: 1; transform: translateY(0); }
#kgp-toast.success { border-left: 4px solid #4caf50; }
#kgp-toast.error   { border-left: 4px solid #f44336; }

.kgp-empty {
    padding: 24px; background: #f8f8f8;
    border-radius: 10px; color: #999;
    text-align: center; font-weight: 600;
}

/* ══════════════════════════════════════════════════════
   KG Collection List (Category Circles)
   ══════════════════════════════════════════════════════ */
.kgpc-wrap, .kgpc-wrap * {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

.kgpc-heading {
    font-size: 26px;
    font-weight: 900;
    color: #1a1a1a;
    text-align: center;
    margin: 0 0 24px;
    letter-spacing: -0.3px;
}

.kgpc-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.kgpc-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
}

.kgpc-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: #3a7d2c;
    border: 0px solid #e8d9c3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.kgpc-item:hover .kgpc-circle {
    transform: scale(1.06);
    box-shadow: 0 10px 28px rgba(0,0,0,0.15);
}
.kgpc-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kgpc-label {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
}

.kgpc-count {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-align: center;
    margin-top: -4px;
}
