/* ANDA Configurator - Frontend Styles v1.9 */

/* ── Price result box ───────────────────────────────────────────────────── */
#anda-price-box {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef1ff 100%);
    border: 2px solid #4f46e5;
    border-radius: 12px;
    padding: 20px 24px;
    margin: 20px 0 0;
    box-shadow: 0 4px 16px rgba(79,70,229,.1);
}
.anda-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}
.anda-total-row        { border-top: 1px solid #d1d5db; margin-top: 8px; padding-top: 12px; }
.anda-price-label      { color: #6b7280; font-size: 14px; }
.anda-price-value      { font-size: 22px; color: #1f2937; }
.anda-price-value-total{ font-size: 28px; color: #4f46e5; font-weight: 700; }
.anda-stock-row        { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e5e7eb; }
.anda-stock-label      { font-size: 13px; color: #059669; }

/* ── "Από Χ€" in the WC price area ──────────────────────────────────────── */
.anda-from-price {
    font-size: 15px;
    color: #4f46e5;
    font-weight: 600;
    display: block;
    margin-top: 4px;
}

/* ── Configurator Wrapper ────────────────────────────────────────────────── */
/* ΚΡΙΣΙΜΟ: width:100% + flex-basis:100% για Kadence flex layout
   Χωρίς αυτό το configurator εμφανίζεται ως flex-item δίπλα στο add-to-cart */
.anda-conf-wrapper {
    width: 100%;
    flex-basis: 100%;      /* σπάει σε νέα γραμμή σε flex container */
    flex-shrink: 0;
    box-sizing: border-box;
    max-width: 100%;
    margin: 24px 0;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    /* Αποτρέπει horizontal overflow από παιδιά */
    overflow-x: hidden;
}
.anda-conf-inner {
    padding: 24px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}
.anda-conf-title    { font-size: 18px; font-weight: 700; color: #1f2937; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.anda-conf-subtitle { color: #6b7280; font-size: 14px; margin: 0 0 20px; }
.anda-conf-loading  { padding: 30px; text-align: center; color: #9ca3af; font-size: 15px; }

/* ── Positions Grid ──────────────────────────────────────────────────────── */
.anda-positions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}
.anda-print-position {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    min-width: 0; /* αποτρέπει overflow σε grid */
}
.anda-print-position.active {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.anda-pos-header { padding: 14px; cursor: pointer; display: flex; align-items: flex-start; gap: 10px; }
.anda-pos-header input[type="checkbox"] {
    width: 18px; height: 18px; margin-top: 4px; cursor: pointer;
    accent-color: #4f46e5; flex-shrink: 0;
}
.anda-pos-header label { cursor: pointer; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.anda-pos-img {
    width: 64px; height: 64px; object-fit: cover;
    border-radius: 8px; border: 1px solid #e5e7eb; flex-shrink: 0;
}
.anda-pos-name {
    font-size: 14px; color: #374151; line-height: 1.4;
    /* Αποτρέπει overflow κειμένου */
    overflow: hidden;
    word-break: break-word;
}

/* ── Position Options ────────────────────────────────────────────────────── */
.anda-pos-options {
    padding: 14px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
    box-sizing: border-box;
    width: 100%;
}
.anda-field            { margin-bottom: 14px; }
.anda-field:last-child { margin-bottom: 0; }
.anda-field label {
    display: block; font-size: 12px; font-weight: 600; color: #6b7280;
    text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px;
}
.anda-tech-select, .anda-colors-input {
    width: 100%; padding: 9px 12px; border: 1px solid #d1d5db;
    border-radius: 8px; font-size: 14px; background: #fff;
    outline: none; transition: border-color .2s; box-sizing: border-box;
    max-width: 100%;
}
.anda-tech-select:focus, .anda-colors-input:focus { border-color: #4f46e5; }
.anda-colors-input  { width: 100px; max-width: 100px; }

/* 18-08-2026 (B2): Το θέμα (woocommerce-grid.min.css) δίνει appearance:none στα select
   και βάζει το βελάκι ως background-image. Το shorthand «background: #fff» της γρ.117
   το ΣΒΗΝΕΙ. Εδώ βάζουμε ΔΙΚΟ ΜΑΣ βελάκι, ώστε να μην εξαρτιόμαστε από το θέμα.
   ΜΟΝΟ στο .anda-tech-select — το .anda-colors-input είναι πεδίο αριθμού. */
.anda-tech-select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px 14px;
    padding-right: 34px;
}
.anda-input-warn    { border-color: #f59e0b !important; background: #fffbeb; }
.anda-colors-row    { display: flex; align-items: center; gap: 10px; }
.anda-colors-help {
    width: 22px; height: 22px; border-radius: 50%;
    background: #e5e7eb; color: #6b7280;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; cursor: help; position: relative;
    flex-shrink: 0;
}
.anda-tooltip {
    display: none; position: absolute; bottom: 28px; left: 50%;
    transform: translateX(-50%);
    background: #1f2937; color: #fff; padding: 8px 12px; border-radius: 8px;
    font-size: 12px; width: 220px; text-align: center; z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,.2); pointer-events: none;
}
.anda-colors-help:hover .anda-tooltip { display: block; }
.anda-color-warn {
    background: #fffbeb; border: 1px solid #fbbf24;
    color: #92400e; padding: 8px 12px; border-radius: 8px;
    font-size: 13px; margin-top: 8px;
}
.anda-embroidery-notice {
    background: #fef3c7; border: 1px solid #fbbf24;
    color: #92400e; padding: 10px 14px; border-radius: 8px;
    font-size: 13px; margin: 8px 0;
}

/* ── Upload ──────────────────────────────────────────────────────────────── */
.anda-upload-area {
    border: 2px dashed #d1d5db; border-radius: 10px; padding: 14px;
    text-align: center; cursor: pointer;
    transition: border-color .2s, background .2s; background: #f9fafb;
    box-sizing: border-box;
    width: 100%;
}
.anda-upload-area:hover, .anda-upload-area.drag-over { border-color: #4f46e5; background: #f0f3ff; }
.anda-upload-btn     { font-size: 14px; color: #4f46e5; font-weight: 600; margin-bottom: 4px; }
.anda-upload-help    { font-size: 11px; color: #9ca3af; margin: 4px 0 0; }
.anda-upload-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; justify-content: center; }

/* ── File tag + ✕ κουμπί (v1.9) ──────────────────────────────────────────── */
.anda-file-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e0e7ff;
    color: #3730a3;
    padding: 4px 8px 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.anda-file-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(55, 48, 163, 0.15);
    border: none;
    color: #3730a3;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.anda-file-remove:hover {
    background: #ef4444;
    color: #fff;
}

.anda-detecting      { color: #6b7280; font-size: 13px; font-style: italic; }

/* ── Color detection result ──────────────────────────────────────────────── */
.anda-detected {
    background: #f0fdf4; border: 1px solid #86efac;
    padding: 10px 12px; border-radius: 8px; margin-top: 8px;
}
.anda-detected-top {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 8px; flex-wrap: wrap;
}
.anda-detected-top > span { font-size: 13px; color: #166534; }
.anda-detected-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* Color swatches */
.anda-swatches {
    display: flex; gap: 5px; flex-wrap: wrap; align-items: center;
}
.anda-swatch {
    display: inline-block;
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.15);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: help;
    flex-shrink: 0;
}

.anda-accept-colors, .anda-reject-colors {
    padding: 5px 14px; border-radius: 6px; font-size: 12px;
    cursor: pointer; border: 1px solid; margin-right: 6px;
}
.anda-accept-colors       { background: #16a34a; color: #fff; border-color: #16a34a; }
.anda-accept-colors:hover { background: #15803d; }
.anda-reject-colors       { background: #fff; color: #374151; border-color: #d1d5db; }
.anda-reject-colors:hover { background: #f3f4f6; }

/* ── Delivery ────────────────────────────────────────────────────────────── */
.anda-conf-delivery {
    margin-top: 12px;
    padding: 10px 16px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    font-size: 13px;
    color: #166534;
}

/* ── No-print ────────────────────────────────────────────────────────────── */
.anda-no-print-wrap  { margin-bottom: 16px; }
.anda-no-print-label { font-size: 14px; color: #374151; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }

/* ── Availability ────────────────────────────────────────────────────────── */
.anda-stock-box     { margin-bottom: 16px; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; font-size: 13px; }
.anda-avail-title   { background: #f9fafb; padding: 8px 14px; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #6b7280; }
.anda-avail-row     { padding: 8px 14px; border-top: 1px solid #f3f4f6; }
.anda-avail-ok      { color: #166534; background: #f0fdf4; }
.anda-avail-mid     { color: #92400e; background: #fffbeb; }
.anda-avail-later   { color: #1e40af; background: #eff6ff; }
.anda-avail-none    { color: #991b1b; background: #fef2f2; }

/* ── Responsive (mobile) ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .anda-conf-wrapper {
        margin: 16px 0;
        border-radius: 12px;
    }
    .anda-conf-inner {
        padding: 16px;
    }
    .anda-conf-title {
        font-size: 16px;
    }
    /* 1 column πάντα σε mobile */
    .anda-positions-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    /* Μικρότερη εικόνα θέσης σε mobile */
    .anda-pos-img {
        width: 48px;
        height: 48px;
    }
    /* Select full width */
    .anda-tech-select {
        font-size: 13px;
        padding: 8px 10px;
    }
    /* Price box μικρότερα νούμερα */
    .anda-price-value       { font-size: 18px; }
    .anda-price-value-total { font-size: 22px; }
    #anda-price-box         { padding: 16px; }
    /* Upload area compact */
    .anda-upload-area {
        padding: 12px;
    }
    .anda-upload-btn {
        font-size: 13px;
    }
    /* Tooltip αριστερά σε mobile για να μην κόβεται */
    .anda-tooltip {
        left: auto;
        right: 0;
        transform: none;
        width: 180px;
    }
}

@media (max-width: 480px) {
    .anda-conf-inner {
        padding: 12px;
    }
    .anda-pos-header {
        padding: 10px 12px;
    }
    .anda-pos-options {
        padding: 10px 12px;
    }
    .anda-conf-subtitle {
        font-size: 13px;
    }
}
