/* Modern Form Styling - Overrides for Existing Classes */
/* Created: 2026-01-04 */
/* Purpose: Apply modern styling to existing standard form classes */
/* Usage: Include this stylesheet to modernize forms without changing HTML structure */

/* ==================== STANDARD INPUT OVERRIDES ==================== */
/* Override the classic bottom-border-only style with modern full borders */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="url"],
input[type="search"] {
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    /* padding: 0.75rem !important; */
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: #fff !important;
    transition: all 0.3s ease !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
input[type="url"]:focus,
input[type="search"]:focus {
    border-color: #FFD100 !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 209, 0, 0.25) !important;
}

/* ==================== SELECT OVERRIDES ==================== */
select {
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 0.75rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: #fff !important;
    transition: all 0.3s ease !important;
}

select:focus {
    border-color: #FFD100 !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 209, 0, 0.25) !important;
}

/* ==================== TEXTAREA OVERRIDES ==================== */
textarea,
.basic_text_input {
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 0.75rem !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: #fff !important;
    transition: all 0.3s ease !important;
    min-height: 100px !important;
}

textarea:focus,
.basic_text_input:focus {
    border-color: #FFD100 !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 209, 0, 0.25) !important;
}

/* ==================== FORM GROUP OVERRIDES ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

/* ==================== LABEL OVERRIDES ==================== */
.basic_form_label,
.form-label,
label {
    display: block;
    margin-bottom: 0.5rem;
    color: #495057 !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
}

/* ==================== FORM BOX OVERRIDES ==================== */
.form_box {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* ==================== PHONE INPUT ==================== */
.phone-input-container {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.phone-input-container .country-code {
    font-weight: 500;
    color: #495057;
    align-items: center;
}

.phone-input-container input {
    border-radius: 8px !important;
}

.basic_form_input_padded {
    padding-left: 50px !important;
}

/* ==================== BUTTONS ==================== */
.submit_button,
.positive_button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
}

.submit_button:hover,
.positive_button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==================== ACCORDION ==================== */
.login_accordion {
    background: #FFD100 !important;
    color: #212529;
    font-weight: 600;
    border-radius: 8px !important;
}

.login_accordion:hover {
    background: #ffc400 !important;
}

.login_accordion_border {
    margin-bottom: 20px;
    border: none !important;
}

.accordion-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.accordion-collapse {
    padding: 20px;
    background: #f8f9fa;
}

/* ==================== SAVED ADDRESSES ==================== */
.saved_addresses {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.saved_addresses label {
    font-weight: 600 !important;
    color: #212529 !important;
    margin-bottom: 0.5rem;
}

.saved_addresses select {
    border-radius: 8px !important;
}

/* ==================== EXPLANATION BOX ==================== */
.explanation,
.explanation_box {
    background: #e8f4f8;
    border-left: 4px solid #0D4563;
    padding: 15px;
    margin-bottom: 25px;
    line-height: 1.6;
    border-radius: 4px;
}

/* ==================== SYSTEM MESSAGES ==================== */
.system_message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* ==================== CART-SPECIFIC CLASSES ==================== */
/* These are page-specific and keep their existing names */

.cart_address_section,
.bordered_option {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.cart_address_heading {
    color: #0D4563;
    font-size: 1.5em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0D4563;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.cart_address_heading .btn {
    margin-left: auto;
    margin-top: 10px;
}

.sub_heading {
    color: #6c757d;
    font-size: 1.1em;
    font-weight: 600;
    margin: 20px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.cart_producer_name {
    color: #0D4563;
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0D4563;
}

/* ==================== TABLES (PAYMENT PAGE) ==================== */
.table-cart-pay {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: separate;
    border-spacing: 0;
}

.table-cart-pay thead td {
    background: #f8f9fa;
    font-weight: 600;
    padding: 12px;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.table-cart-pay tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.table-cart-pay tbody tr:last-child td {
    border-bottom: none;
}

.highlighted_table_row td {
    background: #f8f9fa !important;
    font-weight: 600;
    padding: 12px !important;
}

.highlighted_table_row_main td {
    background: #e8f4f8 !important;
    font-weight: 700;
    font-size: 1.1em;
    padding: 15px 12px !important;
    color: #0D4563;
}

.cart-table-total {
    font-size: 1.05em;
}

.cart-table-total tbody td {
    padding: 12px;
}

.cart-table-total .bold {
    font-weight: 700;
    color: #0D4563;
    font-size: 1.1em;
}

/* ==================== CART CONTENT ==================== */
.cart_content {
    padding: 20px;
}

.cart_content > .row > p {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    line-height: 1.6;
    border-radius: 4px;
}

.cart_content > .row > p a {
    color: #0D4563;
    font-weight: 600;
    text-decoration: underline;
}

.scroll-x {
    overflow-x: auto;
}

/* ==================== STOCK WARNING STYLING ==================== */
/* Minimal table row highlight */
.stock-warning-row td {
    background: #fffbf0 !important;
}

/* Warning icon and tooltip wrapper */
.stock-warning-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: help;
}

.warning-icon-inline {
    color: #ffc107;
    font-size: 1.2rem;
    line-height: 1;
    animation: pulseWarning 2s ease-in-out infinite;
}

@keyframes pulseWarning {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.amount-text {
    font-weight: 600;
}

/* Tooltip that appears on hover/touch */
.stock-warning-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    padding: 10px 15px;
    background: linear-gradient(135deg, #ffc107 0%, #FFD100 100%);
    color: #212529;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

/* Tooltip arrow */
.stock-warning-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #FFD100;
}

/* Show tooltip on hover */
.stock-warning-wrapper:hover .stock-warning-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* Show tooltip on touch/tap for mobile */
.stock-warning-wrapper:active .stock-warning-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .cart_address_heading {
        font-size: 1.2em;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cart_address_heading .btn {
        margin-left: 0;
        width: 100%;
        margin-top: 15px;
    }
    
    .cart_address_section,
    .bordered_option,
    .form_box {
        padding: 15px;
    }
    
    .table-cart-pay {
        font-size: 0.9em;
    }
    
    .table-cart-pay thead td,
    .table-cart-pay tbody td {
        padding: 8px 6px;
    }
    
    .cart_producer_name {
        font-size: 1.1em;
    }
    
    .stock-warning-tooltip {
        font-size: 0.75rem;
        padding: 8px 12px;
        white-space: normal;
        max-width: 200px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .bordered_option,
    .cart_address_section {
        page-break-inside: avoid;
    }
    
    .warning-icon-inline {
        animation: none;
    }
    
    .stock-warning-tooltip {
        display: none;
    }
    
    input,
    select,
    textarea {
        border: 1px solid #000 !important;
    }
}
