/* Theme Conflict Overrides */
.single-product .site {
    overflow-x: unset !important;
}

@media (min-width: 768px) {
    .single-product div.product .woocommerce-product-gallery {
        position: sticky !important;
        top: 0 !important;
    }
}

.single-product div.product form.cart {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 15px;
}

.single-product div.product form.cart .single_add_to_cart_button {
    flex-grow: 1 !important;
}

/* Main Wrapper */
.wcto-wrapper {
    margin: 20px 0;
    font-family: inherit;
    width: 100%;
    flex: 0 0 100%;
}

/* Section Headings - Handled by Accordions now mostly */
.wcto-section-title, .wcto-label.heading {
    font-size: 16px;
    font-weight: 700;
    color: #1D315E;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Fields Layout */
.wcto-fields-section {
    margin-bottom: 25px;
}

.wcto-field-row {
    margin-bottom: 15px;
}

/* ----------------------------------------------
   ACCORDION STYLES (Leepa Sports Colors)
---------------------------------------------- */
.wcto-accordion-header {
    background: #f7f9fb;
    padding: 15px 20px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e1e5eb;
    transition: all 0.2s ease-in-out;
    color: #1D315E; 
}
.wcto-accordion-header:hover, .wcto-accordion-item.active .wcto-accordion-header {
    background: #1D315E;
    color: #ffffff;
    border-color: #1D315E;
}
.wcto-accordion-header:hover .heading, .wcto-accordion-item.active .wcto-accordion-header .heading {
    color: #ffffff;
}
.wcto-accordion-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}
.wcto-accordion-content {
    padding: 20px;
    border: 1px solid #e1e5eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -3px; 
    background: #ffffff;
}
.wcto-accordion-item {
    margin-bottom: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.wcto-matrix-section.wcto-accordion-item {
    padding: 0;
    background: transparent;
    border: none;
}

/* Grid Layouts for Checkboxes/Radios */
.wcto-grid-4 {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.wcto-flex-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ----------------------------------------------
   SWATCH PILLS STYLING
---------------------------------------------- */
.wcto-hidden-input {
    display: none !important;
}

.wcto-pill {
    margin: 0 !important;
    cursor: pointer !important;
    display: inline-block;
}

.wcto-pill-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: #f0f2f5;
    color: #4a5568;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

.wcto-pill:hover .wcto-pill-text {
    background: #e2e8f0;
    color: #1D315E;
}

/* Active State */
.wcto-hidden-input:checked + .wcto-pill-text {
    background: #C41230; /* Vibrant Red from Logo */
    color: #ffffff;
    border-color: #C41230;
    box-shadow: 0 4px 10px rgba(196, 18, 48, 0.25);
}

/* Inputs Styling */
.wcto-input-text, .wcto-select, .wcto-textarea, .wcto-input-number {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 15px;
    color: #2d3748;
    background: #fff;
    transition: border-color 0.2s;
}
.wcto-input-text:focus, .wcto-select:focus, .wcto-textarea:focus, .wcto-input-number:focus {
    border-color: #1D315E;
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 49, 94, 0.1);
}

/* ----------------------------------------------
   SIZE MATRIX STYLES
---------------------------------------------- */
.wcto-matrix-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #eee;
    margin-bottom: 20px;
}

.wcto-size-group {
    margin-bottom: 20px;
}
.wcto-size-group:last-child {
    margin-bottom: 0;
}

.wcto-group-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.wcto-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wcto-size-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
}

.wcto-size-label {
    font-size: 12px;
    margin-bottom: 4px;
    text-align: center;
    display: block;
}

.wcto-qty-input {
    width: 100% !important;
    text-align: center;
    padding: 5px !important;
    height: 40px !important;
}

/* Total Bar */
.wcto-total-bar {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 2px dashed #e2e8f0;
    text-align: right;
    font-size: 18px;
    color: #2d3748;
}

#wcto-total-qty-display {
    color: #C41230; /* Leepa Red */
    font-weight: 800;
    font-size: 24px;
    margin-left: 10px;
}

/* Modal Trigger Button */
.wcto-modal-trigger-section {
    margin-top: 25px;
}
button#wcto-open-modal {
    width: 100%;
    background-color: #1D315E; /* Deep Blue */
    color: #ffffff;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(29, 49, 94, 0.3);
}
button#wcto-open-modal:hover:not(:disabled) {
    background-color: #162445;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 49, 94, 0.4);
}
button#wcto-open-modal:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #a0aec0;
    box-shadow: none;
}


/* ----------------------------------------------
   MODAL STYLES
---------------------------------------------- */
.wcto-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcto-modal-container {
    background: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    overflow: hidden;
}

.wcto-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #162445;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1D315E; /* Leepa Deep Blue */
    color: #ffffff;
}
.wcto-modal-header h3 { 
    margin: 0; 
    font-size: 20px; 
    font-weight: 700;
    color: #ffffff;
}

.wcto-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    color: #cbd5e0;
    transition: color 0.2s;
}
.wcto-modal-close:hover {
    color: #ffffff;
}

.wcto-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    background: #f7f9fb;
}

.wcto-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Modal Buttons */
.wcto-save-modal {
    background: #C41230 !important; /* Vivid Red */
    color: #ffffff !important;
    border: none !important;
    padding: 10px 25px !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    box-shadow: 0 4px 10px rgba(196, 18, 48, 0.2) !important;
    transition: all 0.2s !important;
}
.wcto-save-modal:hover {
    background: #a30e26 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 15px rgba(196, 18, 48, 0.3) !important;
}

.wcto-clear-all {
    background: #ffffff !important;
    color: #1D315E !important;
    border: 1px solid #1D315E !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
}
.wcto-clear-all:hover {
    background: #f0f2f5 !important;
}

/* Roster Table Grid */
.wcto-roster-table-header {
    display: grid;
    grid-template-columns: 40px 80px 1fr 100px; /* #, Size, Name, Number */
    background: #eee;
    padding: 8px 10px;
    font-weight: 600;
    font-size: 13px;
    gap: 10px;
    margin-bottom: 10px;
}

.wcto-roster-row {
    display: grid;
    grid-template-columns: 40px 80px 1fr 100px;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.wcto-roster-row input {
    width: 100%;
    padding: 6px;
}

/* Mobile Responsive Modal */
@media (max-width: 600px) {
    .wcto-roster-table-header { display: none; } /* Hide header on mobile */
    .wcto-roster-row {
        grid-template-columns: 1fr 1fr; /* Stack inputs */
        border: 1px solid #eee;
        padding: 10px;
        background: #fafafa;
        gap: 8px;
    }
    .wcto-roster-row .row-meta { 
        grid-column: 1 / -1; 
        font-weight: bold; 
        margin-bottom: 5px;
    }
}

/* Warning Alert */
.wcto-alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}
.wcto-warning-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}
