/**
 * SoulPrise Personalizacion - Frontend Styles
 * Clean, elegant, neutral palette — adapts to any brand.
 * Cuantium AI Agencia LLC
 */

/* === Container === */
.sp-personalization {
    margin: 24px 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    padding: 22px 0;
}

.sp-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1a1a1a;
    margin: 0 0 20px;
    padding: 0;
    border: 0;
    display: block;
}

.sp-title::before { content: none; }

/* === Property === */
.sp-property {
    margin-bottom: 22px;
}

.sp-property:last-child {
    margin-bottom: 0;
}

.sp-property-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.sp-required {
    color: #999;
    margin-left: 2px;
}

/* === Swatches === */
.sp-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sp-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 6px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-width: 54px;
    min-height: 66px;
    text-align: center;
    outline: none;
    font-family: inherit;
}

.sp-swatch:hover {
    border-color: #1a1a1a;
}

.sp-swatch.selected {
    border-color: #1a1a1a;
    box-shadow: inset 0 0 0 1px #1a1a1a;
    background: #fff;
}

/* Circle color dot */
.sp-swatch-circle {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    transition: transform 0.15s ease;
}

.sp-swatch.selected .sp-swatch-circle {
    border-color: #1a1a1a;
}

/* Image swatch variant */
.sp-swatch-img-wrap {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    background: #fff;
    transition: border-color 0.15s ease;
}

.sp-swatch-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sp-swatch.selected .sp-swatch-img-wrap {
    border-color: #1a1a1a;
}

.sp-swatch-image {
    min-width: 76px;
}

.sp-swatch-name {
    font-size: 10px;
    color: #555;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sp-swatch.selected .sp-swatch-name {
    color: #1a1a1a;
    font-weight: 600;
}

.sp-swatch-price {
    font-size: 10px;
    color: #666;
    font-weight: 500;
}

/* === Dropdown === */
.sp-personalization select.sp-dropdown {
    width: 100%;
    max-width: 320px;
    height: 46px;
    line-height: 22px;
    padding: 10px 36px 10px 14px;
    margin: 0;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: border-color 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23333'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    font-family: inherit;
    box-sizing: border-box;
    vertical-align: middle;
    text-indent: 0;
    box-shadow: none;
}

.sp-personalization select.sp-dropdown:focus {
    border-color: #1a1a1a;
    outline: none;
    box-shadow: none;
}

.sp-personalization select.sp-dropdown:hover {
    border-color: #1a1a1a;
}

.sp-personalization select.sp-dropdown option {
    color: #333;
    background: #fff;
    padding: 6px;
}

/* === Validation Error === */
.sp-property.sp-error .sp-property-label {
    color: #b91c1c;
}

.sp-property.sp-error .sp-swatches {
    border: 1px solid #fca5a5;
    border-radius: 4px;
    padding: 6px;
}

.sp-property.sp-error .sp-dropdown {
    border-color: #b91c1c;
}

/* === Responsive === */
@media (max-width: 768px) {
    .sp-personalization { padding: 18px 0; }
    .sp-swatches { gap: 6px; }
    .sp-swatch { min-width: 56px; min-height: 70px; padding: 8px 6px; }
    .sp-swatch-circle { width: 24px; height: 24px; }
    .sp-swatch-img-wrap { width: 36px; height: 36px; }
    .sp-swatch-name { font-size: 9px; }
    .sp-dropdown { max-width: 100%; }
    .sp-title { font-size: 12px; }
}

@media (max-width: 480px) {
    .sp-swatches { gap: 5px; }
    .sp-swatch { min-width: 50px; padding: 6px 4px; }
    .sp-swatch-circle { width: 22px; height: 22px; }
    .sp-swatch-img-wrap { width: 32px; height: 32px; }
}

/* === Tiles (replacement for dropdown) === */
.sp-personalization .sp-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sp-personalization .sp-tile {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    font-family: inherit;
    color: #1a1a1a;
    min-width: 64px;
}
.sp-personalization .sp-tile:hover { border-color: #1a1a1a; }
.sp-personalization .sp-tile.selected {
    border-color: #1a1a1a;
    box-shadow: inset 0 0 0 1px #1a1a1a;
}

/* Icon tiles (size, decoration) */
.sp-personalization .sp-tile-icon { min-width: 86px; min-height: 92px; padding: 12px 10px; }
.sp-personalization .sp-tile-graphic {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    color: #333;
}
.sp-personalization .sp-tile-graphic svg { display: block; }
.sp-personalization .sp-tile.selected .sp-tile-graphic { color: #000; }

/* Number tiles */
.sp-personalization .sp-tile-number {
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    font-weight: 500;
}
.sp-personalization .sp-tile-number .sp-tile-num {
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #1a1a1a;
    line-height: 1;
}
.sp-personalization .sp-tile-number.selected .sp-tile-num { font-weight: 700; }

/* Text tiles (fallback) */
.sp-personalization .sp-tile-text {
    padding: 10px 16px;
    min-height: 40px;
}

/* Labels */
.sp-personalization .sp-tile-label {
    font-size: 10px;
    color: #555;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
}
.sp-personalization .sp-tile.selected .sp-tile-label {
    color: #1a1a1a;
    font-weight: 600;
}
.sp-personalization .sp-tile-price {
    font-size: 10px;
    color: #666;
    font-weight: 500;
}
.sp-personalization .sp-tile-price .amount { color: #666; }

/* Error state on tiles */
.sp-personalization .sp-property.sp-error .sp-tiles {
    border: 1px solid #fca5a5;
    border-radius: 4px;
    padding: 6px;
}

/* Hide legacy select styling since we replaced dropdown with tiles */
.sp-personalization select.sp-dropdown { display: none; }

@media (max-width: 768px) {
    .sp-personalization .sp-tile-icon { min-width: 74px; min-height: 82px; padding: 10px 8px; }
    .sp-personalization .sp-tile-number { min-width: 42px; min-height: 42px; }
    .sp-personalization .sp-tile-number .sp-tile-num { font-size: 15px; }
    .sp-personalization .sp-tile-graphic { width: 34px; height: 34px; }
    .sp-personalization .sp-tile-graphic svg { width: 34px; height: 34px; }
}
