/**
 * Subscription Constructor Styles
 * Theme colors: #00d1f9 (primary cyan), #002c8f (dark blue)
 */

/* ============================================
   SUBSCRIPTION CONSTRUCTOR SECTION
   ============================================ */

.subscription-constructor-section {
    position: relative;
    padding: 100px 0 80px;
    background: linear-gradient(135deg, #f8fdff 0%, #ffffff 100%);
}

.subscription-constructor-section .pattern-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.05;
}

/* Section Title */
.subscription-constructor-section .sec-title {
    text-align: center;
    margin-bottom: 50px;
}

.subscription-constructor-section .sec-title h2 {
    font-size: 40px;
    font-weight: 800;
    color: #002c8f;
    margin-bottom: 15px;
    line-height: 1.3;
}

.subscription-constructor-section .sec-title p {
    font-size: 16px;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Constructor Container */
.constructor-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
    padding: 50px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Step Indicator */
.constructor-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 50px;
    position: relative;
}

.constructor-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: #e5e5e5;
    z-index: 0;
}

.constructor-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e5e5;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 10px;
    transition: all 0.3s ease;
}

.constructor-step.active .step-number {
    background: linear-gradient(135deg, #00d1f9 0%, #002c8f 100%);
    color: #ffffff;
    box-shadow: 0 5px 15px rgba(0, 209, 249, 0.4);
    transform: scale(1.15);
}

.constructor-step.completed .step-number {
    background: #28a745;
    color: #ffffff;
}

.step-label {
    font-size: 14px;
    font-weight: 600;
    color: #999;
    transition: color 0.3s ease;
}

.constructor-step.active .step-label {
    color: #00d1f9;
}

.constructor-step.completed .step-label {
    color: #28a745;
}

/* Constructor Content */
.constructor-content {
    min-height: 400px;
}

.constructor-panel {
    display: none;
}

.constructor-panel.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Product Selection */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.product-card {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    border-color: #00d1f9;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 209, 249, 0.2);
}

.product-card.selected {
    border-color: #00d1f9;
    background: linear-gradient(135deg, #f8fdff 0%, #ffffff 100%);
}

.product-card .product-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-bottom: 15px;
}

.product-card .product-name {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
}

.product-card .product-price {
    font-size: 18px;
    font-weight: 800;
    color: #00d1f9;
    margin-bottom: 15px;
}

.product-card .quantity-control {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.product-card.selected .quantity-control {
    display: flex;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #00d1f9;
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: #002c8f;
    transform: scale(1.1);
}

.quantity-display {
    font-size: 18px;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

/* Delivery Frequency Selection */
.frequency-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.frequency-option {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.frequency-option:hover {
    border-color: #00d1f9;
    transform: translateY(-3px);
}

.frequency-option.selected {
    border-color: #00d1f9;
    background: linear-gradient(135deg, #f8fdff 0%, #ffffff 100%);
    box-shadow: 0 8px 25px rgba(0, 209, 249, 0.2);
}

.frequency-option .frequency-icon {
    font-size: 40px;
    color: #00d1f9;
    margin-bottom: 15px;
}

.frequency-option .frequency-name {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
}

.frequency-option .frequency-description {
    font-size: 14px;
    color: #666;
}

/* Delivery Schedule */
.schedule-selector {
    margin-bottom: 30px;
}

.schedule-label {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 15px;
}

.day-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.day-btn {
    padding: 12px 20px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.day-btn:hover {
    border-color: #00d1f9;
    color: #00d1f9;
}

.day-btn.selected {
    border-color: #00d1f9;
    background: #00d1f9;
    color: #fff;
}

/* Time Slots Dropdown */
#time-slots-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 48px !important;
}

#time-slots-select:hover {
    border-color: #00d1f9;
}

#time-slots-select:focus {
    outline: none;
    border-color: #00d1f9;
    box-shadow: 0 0 0 3px rgba(0, 209, 249, 0.1);
}

/* Cost Preview */
.cost-preview {
    background: linear-gradient(135deg, #002c8f 0%, #00d1f9 100%);
    color: #fff;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.cost-preview h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cost-row:last-child {
    border-bottom: none;
    padding-top: 20px;
    font-size: 20px;
    font-weight: 800;
}

.cost-label {
    font-size: 16px;
}

.cost-value {
    font-weight: 700;
}

/* Navigation Buttons */
.constructor-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    width: 100%;
}

.constructor-navigation .nav-btn-prev[style*="display: none"] ~ .nav-btn-next,
.constructor-navigation .nav-btn-prev[style*="display: none"] ~ .nav-btn-submit {
    margin-left: auto;
}

.nav-btn {
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-btn-prev {
    background: #fff;
    border-color: #e5e5e5;
    color: #666;
}

.nav-btn-prev:hover {
    border-color: #00d1f9;
    color: #00d1f9;
}

.nav-btn-next, .nav-btn-submit {
    background: linear-gradient(135deg, #00d1f9 0%, #002c8f 100%);
    border-color: transparent;
    color: #fff;
}

.nav-btn-next:hover, .nav-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 209, 249, 0.4);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading State */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #00d1f9;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 991px) {
    .constructor-container {
        padding: 35px;
    }

    .subscription-constructor-section .sec-title h2 {
        font-size: 32px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }

    .frequency-options {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .subscription-constructor-section {
        padding: 60px 0 40px;
    }

    .constructor-container {
        padding: 25px;
    }

    .subscription-constructor-section .sec-title h2 {
        font-size: 28px;
    }

    .constructor-steps::before {
        display: none;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .frequency-options {
        grid-template-columns: 1fr;
    }

    .constructor-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .nav-btn {
        width: 100%;
    }
}
