/**
 * WebAthletics Bracciale Athleticon - Frontend Styles
 * Design: Apple Minimal Style
 */

/* Container */
.waba-configurator {
    max-width: 800px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #1d1d1f;
}

/* Header - Apple Minimal Style */
.waba-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 30px;
    background: #ffffff;
    border: 1px solid #d2d2d7;
    border-radius: 18px;
    color: #1d1d1f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.waba-title {
    margin: 0 0 12px 0;
    font-size: 40px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.5px;
    color: #1d1d1f;
}

.waba-description {
    margin: 12px 0;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.4;
    color: #6e6e73;
}

.waba-brands {
    margin-top: 20px;
    font-size: 14px;
    color: #86868b;
    font-weight: 400;
}

.waba-brand {
    font-weight: 500;
}

.waba-separator {
    margin: 0 8px;
    color: #d2d2d7;
}

/* Gallery Section Stacked */
.waba-gallery-stacked {
    margin-bottom: 40px;
}

.waba-main-image-container {
    background: #ffffff;
    border: 1px solid #d2d2d7;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
}

.waba-main-image-container img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.waba-zoom-hint {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.waba-main-image-container:hover .waba-zoom-hint {
    opacity: 1;
}

.waba-thumbnails {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.waba-thumbnail {
    background: #ffffff;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.waba-thumbnail:hover {
    border-color: #1d1d1f;
}

.waba-thumbnail.active {
    border-color: #1d1d1f;
    box-shadow: 0 0 0 2px #1d1d1f;
}

.waba-thumbnail img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Lightbox */
.waba-lightbox {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.waba-lightbox.open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.waba-lightbox-content {
    display: block;
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 4px;
}

.waba-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 50px;
    font-weight: 200;
    transition: 0.3s;
    cursor: pointer;
    line-height: 1;
    z-index: 100000;
}

.waba-lightbox-close:hover,
.waba-lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Form - Clean White */
.waba-form {
    background: #ffffff;
    border-radius: 18px;
    padding: 40px;
    border: 1px solid #d2d2d7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
}

.waba-field {
    margin-bottom: 32px;
}

.waba-label {
    display: block;
    font-weight: 600;
    font-size: 17px;
    margin-bottom: 12px;
    color: #1d1d1f;
    letter-spacing: -0.2px;
}

.waba-required {
    color: #ff3b30;
    margin-left: 3px;
}

/* Metal Selection - Apple Card Style */
.waba-metal-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.waba-radio-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.waba-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.waba-radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    background: #fbfbfd;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    position: relative;
}

.waba-radio-card input[type="radio"]:checked + .waba-radio-content {
    border-color: #1d1d1f;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.waba-radio-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #d2d2d7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
    transition: all 0.2s ease;
}

.waba-radio-card input[type="radio"]:checked + .waba-radio-content .waba-radio-icon {
    background: #1d1d1f;
    border-color: #1d1d1f;
    color: white;
}

.waba-radio-label {
    font-size: 19px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.waba-radio-price {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.5px;
}

/* Custom Select Dropdown with Colors */
.waba-custom-select {
    position: relative;
    width: 100%;
}

.waba-custom-select-trigger {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #fbfbfd;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.waba-custom-select-trigger:hover {
    background: #ffffff;
}

.waba-custom-select.open .waba-custom-select-trigger {
    border-color: #1d1d1f;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(29, 29, 31, 0.06);
}

.waba-select-color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f0f0f0;
    border: 1.5px solid #d2d2d7;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.waba-select-text {
    flex: 1;
    font-size: 17px;
    color: #1d1d1f;
    font-weight: 400;
}

.waba-select-arrow {
    margin-left: 12px;
    font-size: 10px;
    color: #86868b;
    transition: transform 0.2s ease;
}

.waba-custom-select.open .waba-select-arrow {
    transform: rotate(180deg);
}

.waba-custom-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.waba-custom-select.open .waba-custom-options {
    display: block;
}

.waba-custom-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.waba-custom-option:hover {
    background: #f5f5f7;
}

.waba-custom-option.selected {
    background: #e8f5e9;
}

.waba-option-color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    margin-right: 12px;
    flex-shrink: 0;
}

.waba-option-text {
    font-size: 16px;
    color: #1d1d1f;
    font-weight: 400;
}

/* Scrollbar for options */
.waba-custom-options::-webkit-scrollbar {
    width: 8px;
}

.waba-custom-options::-webkit-scrollbar-track {
    background: #f5f5f7;
    border-radius: 0 12px 12px 0;
}

.waba-custom-options::-webkit-scrollbar-thumb {
    background: #d2d2d7;
    border-radius: 4px;
}

.waba-custom-options::-webkit-scrollbar-thumb:hover {
    background: #86868b;
}

/* Input - Apple Style */
.waba-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 17px;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    background: #fbfbfd;
    transition: all 0.2s ease;
    font-family: inherit;
    color: #1d1d1f;
}

.waba-input:focus {
    outline: none;
    border-color: #1d1d1f;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(29, 29, 31, 0.06);
}

.waba-input::placeholder {
    color: #86868b;
}

.waba-char-count {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #86868b;
    font-weight: 400;
}

/* Price Summary - Minimal */
.waba-price-summary {
    background: #ffffff;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    padding: 24px;
    margin: 32px 0;
}

.waba-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.waba-price-label {
    font-size: 21px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.3px;
}

.waba-price-amount {
    font-size: 36px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.8px;
}

/* Actions - Apple Button */
.waba-actions {
    margin-top: 32px;
}

.waba-btn {
    display: block;
    width: 100%;
    padding: 17px 24px;
    font-size: 17px;
    font-weight: 500;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    font-family: inherit;
    letter-spacing: -0.2px;
}

.waba-btn-primary {
    background: #1d1d1f;
    color: #ffffff;
}

.waba-btn-primary:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.waba-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.waba-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Error Message - Apple Style */
.waba-error-message {
    background: #fff5f5;
    border: 1px solid #ff3b30;
    border-left: 4px solid #ff3b30;
    color: #c7254e;
    padding: 16px;
    border-radius: 12px;
    margin-top: 20px;
    font-size: 15px;
    font-weight: 400;
}

/* Loading Overlay */
.waba-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    z-index: 100;
}

.waba-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e5ea;
    border-top: 3px solid #1d1d1f;
    border-radius: 50%;
    animation: waba-spin 0.8s linear infinite;
}

@keyframes waba-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.waba-loading p {
    margin-top: 20px;
    font-size: 15px;
    color: #86868b;
    font-weight: 400;
}

/* Info Box - Minimal */
.waba-info-box {
    background: #f5f5f7;
    border-radius: 18px;
    padding: 32px;
    margin-top: 32px;
    border: 1px solid #d2d2d7;
}

.waba-info-box h3 {
    margin-top: 0;
    color: #1d1d1f;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.waba-info-box ul {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.waba-info-box ul li {
    padding: 10px 0;
    font-size: 17px;
    line-height: 1.5;
    color: #1d1d1f;
    font-weight: 400;
}

/* Success Message */
.waba-success-message {
    background: #f0fdf4;
    border: 1px solid #34c759;
    border-left: 4px solid #34c759;
    color: #166534;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
}

/* Cancel Message */
.waba-cancel-message {
    background: #fffbeb;
    border: 1px solid #ff9500;
    border-left: 4px solid #ff9500;
    color: #92400e;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
}

/* Responsive - Tablet */
@media (max-width: 992px) {
    .waba-main-image-container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .waba-configurator {
        margin: 24px auto;
        padding: 0 16px;
    }

    .waba-header {
        padding: 32px 24px;
    }

    .waba-title {
        font-size: 32px;
    }

    .waba-description {
        font-size: 17px;
    }

    .waba-form {
        padding: 28px 24px;
    }

    .waba-metal-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .waba-price-amount {
        font-size: 32px;
    }

    .waba-btn {
        font-size: 17px;
        padding: 16px 24px;
    }

    .waba-info-box {
        padding: 24px;
    }

    .waba-info-box h3 {
        font-size: 21px;
    }

    .waba-info-box ul li {
        font-size: 16px;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .waba-configurator {
        margin: 16px auto;
        padding: 0 12px;
    }

    .waba-header {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .waba-title {
        font-size: 28px;
    }

    .waba-description {
        font-size: 16px;
    }

    .waba-brands {
        font-size: 13px;
    }

    .waba-form {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .waba-field {
        margin-bottom: 28px;
    }

    .waba-radio-content {
        padding: 20px 16px;
    }

    .waba-radio-label {
        font-size: 17px;
    }

    .waba-radio-price {
        font-size: 24px;
    }

    /* Select più grande su mobile */
    .waba-select {
        padding: 16px 40px 16px 16px;
        font-size: 16px;
    }

    .waba-input {
        padding: 16px;
        font-size: 16px;
    }

    .waba-price-label {
        font-size: 19px;
    }

    .waba-price-amount {
        font-size: 28px;
    }

    .waba-btn {
        padding: 16px 24px;
        font-size: 17px;
    }

    .waba-info-box {
        padding: 20px;
        border-radius: 16px;
    }

    .waba-info-box h3 {
        font-size: 19px;
    }

    .waba-info-box ul li {
        font-size: 15px;
        padding: 8px 0;
    }
}
