/* ==========================================================
   Flag Configurator Pro – Front-end Styles
   ========================================================== */

:root {
    --fcp-primary: #1a1a2e;
    --fcp-accent: #e94560;
    --fcp-gold: #D4AF37;
    --fcp-bg: #f8f9fc;
    --fcp-card-bg: #ffffff;
    --fcp-border: #e2e5ec;
    --fcp-text: #2c2f3a;
    --fcp-muted: #7a8099;
    --fcp-radius: 10px;
    --fcp-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    --fcp-transition: 0.2s ease;
}

/* ── Gallery replacement canvas ───────────────────────────── */
.fcp-gallery-replacement {
    width: 100%;
    position: relative;
}

.fcp-gallery-canvas-wrap {
    background: var(--fcp-card-bg);
    border: 1px solid var(--fcp-border);
    border-radius: var(--fcp-radius);
    overflow: hidden;
    box-shadow: var(--fcp-shadow);
    position: sticky;
    top: 100px;
}

.fcp-canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--fcp-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    gap: 8px;
}

.fcp-canvas-header>span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fcp-active-zone-label {
    font-size: 11px;
    background: var(--fcp-accent);
    padding: 2px 8px;
    border-radius: 20px;
    display: none;
}

.fcp-active-zone-label.visible {
    display: inline-block;
}

/* ── Fringe wrap: renders the gold border OUTSIDE the SVG ─── */
.fcp-fringe-wrap {
    position: relative;
    display: block;
}

.fcp-fringe-wrap.fcp-fringe-active {
    /* Gold fringe shimmer border rendered via box-shadow so it sits outside the SVG box */
    padding: 0;
}

.fcp-fringe-wrap.fcp-fringe-active .fcp-canvas-container::before {
    content: '';
    position: absolute;
    inset: 10px;
    /* inset matches the 16px padding minus flag edge */
    border: 8px solid var(--fcp-gold);
    border-radius: 2px;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3), inset 0 0 0 2px rgba(212, 175, 55, 0.3);
    /* Fringe texture using repeating gradient on all 4 edges */
    background-image:
        repeating-linear-gradient(to right, transparent 0, transparent 3px, rgba(180, 140, 20, 0.7) 3px, rgba(180, 140, 20, 0.7) 5px),
        repeating-linear-gradient(to right, transparent 0, transparent 3px, rgba(180, 140, 20, 0.7) 3px, rgba(180, 140, 20, 0.7) 5px),
        repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(180, 140, 20, 0.7) 3px, rgba(180, 140, 20, 0.7) 5px),
        repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(180, 140, 20, 0.7) 3px, rgba(180, 140, 20, 0.7) 5px);
    background-size: 100% 8px, 100% 8px, 8px 100%, 8px 100%;
    background-position: 0 0, 0 100%, 0 0, 100% 0;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

/* ── Eyelets: HTML divs positioned OUTSIDE the SVG canvas ─── */
.fcp-eyelet {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #e0e0e0 20%, #888 70%, #444 100%);
    border: 2px solid #444;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.4);
    z-index: 20;
    pointer-events: none;
}

.fcp-eyelet-tl {
    /* Sit on the left edge of the flag: 16px SVG padding, nudged slightly inside */
    top: 16px;
    /* flush with the top of the SVG */
    left: 14px;
    /* on the flag's left border */
    transform: translate(-50%, 4px);
    /* small downward nudge so it feels on-flag */
}

.fcp-eyelet-bl {
    bottom: 16px;
    /* flush with the bottom of the SVG */
    left: 14px;
    transform: translate(-50%, -4px);
    /* small upward nudge so it feels on-flag */
}

.fcp-canvas-container {
    background: #e8e8e8;
    background-image: linear-gradient(45deg, #d0d0d0 25%, transparent 25%),
        linear-gradient(-45deg, #d0d0d0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d0d0d0 75%),
        linear-gradient(-45deg, transparent 75%, #d0d0d0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    cursor: grab;
    min-height: 240px;
    position: relative;
}

.fcp-canvas-container:active {
    cursor: grabbing;
}

.fcp-svg-canvas {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    cursor: grab;
    touch-action: none;
}

.fcp-svg-canvas:active {
    cursor: grabbing;
}

/* ── Configurator controls (right column in product summary) ─ */
.fcp-configurator {
    background: var(--fcp-bg);
    border: 1px solid var(--fcp-border);
    border-radius: var(--fcp-radius);
    padding: 16px;
    margin: 16px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--fcp-text);
}

/* ── Section header ──────────────────────────────────────── */
.fcp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.fcp-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--fcp-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.fcp-zone-count {
    font-size: 11px;
    background: var(--fcp-accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

/* ── Zone selectors ──────────────────────────────────────── */
.fcp-zones {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.fcp-zone-selector {
    border: 2px solid var(--fcp-border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color var(--fcp-transition);
}

.fcp-zone-selector.fcp-has-selection {
    border-color: #4CAF50;
}

.fcp-zone-selector.fcp-active-search {
    border-color: var(--fcp-accent);
}

.fcp-zone-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f5f7fb;
    border-bottom: 1px solid var(--fcp-border);
    flex-wrap: wrap;
}

.fcp-zone-indicator {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fcp-zone-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--fcp-text);
    flex: 1;
}

.fcp-zone-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
}

.fcp-selected-flag {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #e8f5e9;
    padding: 3px 7px;
    border-radius: 20px;
}

.fcp-selected-flag-img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}

.fcp-selected-flag-name {
    font-size: 11px;
    font-weight: 600;
    color: #2e7d32;
    max-width: 70px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fcp-clear-zone {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    line-height: 1;
}

.fcp-clear-zone:hover {
    color: var(--fcp-accent);
}

/* ── Per-zone zoom buttons ───────────────────────────────── */
.fcp-zone-zoom {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(26, 26, 46, 0.07);
    border-radius: 6px;
    padding: 2px 4px;
}

.fcp-zone-zoom-btn {
    background: var(--fcp-primary);
    border: none;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--fcp-transition);
    padding: 0;
    line-height: 1;
}

.fcp-zone-zoom-btn:hover {
    background: var(--fcp-accent);
}

/* ── Flag search & grid ──────────────────────────────────── */
.fcp-flag-search-wrap {
    padding: 7px;
}

.fcp-flag-search {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--fcp-border);
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    transition: border-color var(--fcp-transition);
    box-sizing: border-box;
}

.fcp-flag-search:focus {
    border-color: var(--fcp-accent);
}

.fcp-flag-grid {
    padding: 4px 7px 7px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    max-height: 170px;
    overflow-y: auto;
}

.fcp-flag-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 3px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: none;
    cursor: pointer;
    transition: all var(--fcp-transition);
    text-align: center;
}

.fcp-flag-btn:hover {
    background: #f0f4ff;
    border-color: #c5d0ff;
}

.fcp-flag-btn.fcp-selected {
    background: #e8f5e9;
    border-color: #4CAF50;
}

.fcp-flag-img {
    width: 34px;
    height: 22px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.fcp-flag-btn-name {
    font-size: 8px;
    color: var(--fcp-muted);
    line-height: 1.2;
    max-width: 56px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Add-ons ─────────────────────────────────────────────── */
.fcp-addons {
    background: var(--fcp-card-bg);
    border: 1px solid var(--fcp-border);
    border-radius: var(--fcp-radius);
    overflow: hidden;
    margin-bottom: 14px;
}

.fcp-addons .fcp-section-header {
    padding: 10px 14px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--fcp-border);
    background: #f5f7fb;
}

.fcp-toggle-icon {
    font-size: 14px;
    color: var(--fcp-muted);
}

.fcp-addon-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
}

.fcp-addon-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 2px solid var(--fcp-border);
    border-radius: 7px;
    cursor: pointer;
    transition: all var(--fcp-transition);
    user-select: none;
}

.fcp-addon-item:hover {
    border-color: var(--fcp-accent);
    background: #fff5f6;
}

.fcp-addon-item:has(input:checked) {
    border-color: var(--fcp-accent);
    background: #fff0f3;
}

.fcp-addon-none:has(input:checked) {
    border-color: var(--fcp-border);
    background: #f9f9f9;
}

.fcp-addon-radio {
    display: none;
}

/* ── None option icon ─────────────────────────────────────── */
.fcp-icon-none {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: 2px dashed #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fcp-icon-fringe {
    width: 28px;
    height: 20px;
    flex-shrink: 0;
    background: linear-gradient(to bottom, var(--fcp-gold) 40%, transparent 40%),
        repeating-linear-gradient(to right, transparent, transparent 3px, var(--fcp-gold) 3px, var(--fcp-gold) 5px);
    border-radius: 2px;
}

.fcp-icon-eyelets {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    background: radial-gradient(circle at 35% 35%, #ccc 30%, #777 100%);
    border: 2px solid #555;
}

.fcp-addon-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.fcp-addon-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--fcp-accent);
}

/* ── Price box ───────────────────────────────────────────── */
.fcp-price-box {
    background: var(--fcp-primary);
    color: #fff;
    border-radius: var(--fcp-radius);
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.fcp-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    opacity: 0.85;
}

.fcp-total-row {
    font-size: 17px;
    opacity: 1;
    padding-top: 6px;
    margin-top: 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* ── Validation ──────────────────────────────────────────── */
.fcp-validation-msg {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 9px 13px;
    margin-top: 8px;
    font-size: 13px;
    color: #856404;
}

/* ── Cart preview (static, non-interactive) ─────────────── */
.fcp-cart-preview {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 6px 0 2px;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    background: #fff;
    pointer-events: none;
    /* completely static – no drag/zoom */
    user-select: none;
}

.fcp-cart-preview svg {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    cursor: default;
}

/* ── Scrollbar styling ───────────────────────────────────── */
.fcp-flag-grid::-webkit-scrollbar {
    width: 4px;
}

.fcp-flag-grid::-webkit-scrollbar-track {
    background: transparent;
}

.fcp-flag-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* ── Admin inline styles ─────────────────────────────────── */
.fcp-admin-config {
    background: #f8f9fc;
    border: 1px solid #e2e5ec;
    border-radius: 8px;
    padding: 14px;
    margin: 12px 0;
}

.fcp-admin-config h4 {
    margin: 0 0 8px;
    color: #1a1a2e;
}

.fcp-item-config {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e5ec;
}


.product_list_widget>li img:not(.fcp-cart-preview img) {
    max-width: 65px !important;
}

.fcp-cart-preview img {
    height: 90px !important;
    max-width: 100% !important;
}

.fcp-cart-preview {
    border: none !important;
}