/**
 * Add to Cart Widget Styles - iaBilet Design
 * Single Add to Cart button, quantities start at 0
 */

/* ========================================
   Widget Container
   ======================================== */
.goticketing-widget {
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Loading State */
.goticketing-widget.goticketing-loading {
    text-align: center;
    padding: 40px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.goticketing-spinner-large {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 115, 170, 0.2);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: goticketing-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes goticketing-spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.goticketing-widget.goticketing-error {
    padding: 20px;
    background: #fff3cd;
    color: #856404;
    text-align: center;
    border: 1px solid #ffc107;
    border-radius: 8px;
}

/* No Plans State */
.goticketing-widget.goticketing-no-plans {
    padding: 30px 20px;
    background: #f8f9fa;
    color: #6c757d;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

/* ========================================
   Plans Container
   ======================================== */
.goticketing-plans-container {
    padding: 0;
}

/* ========================================
   Pricing Group
   ======================================== */
.goticketing-pricing-group {
    margin-bottom: 10px;
}

.goticketing-pricing-group:last-child {
    margin-bottom: 0;
}

.goticketing-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f5f7f9;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid #e0e0e0;
    border-radius: 6px 6px 0 0;
}

.goticketing-group-header:hover {
    background: #e8ecef;
}

.goticketing-group-header.collapsed {
    border-radius: 6px;
}

.goticketing-group-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    line-height: 0;
    flex-shrink: 0;
    width: 1.5em;
    height: 1.5em;
    min-width: 1.5em;
    min-height: 1.5em;
    box-sizing: border-box;
}

.goticketing-group-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.goticketing-group-icon.goticketing-icon-wrap,
.goticketing-group-icon.goticketing-icon-font {
    width: 1em;
    height: 1em;
}

.goticketing-group-icon-wrapper svg {
    fill: currentColor;
}

.goticketing-group-icon.goticketing-icon-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
    vertical-align: middle;
}

.goticketing-group-info {
    flex: 1;
    min-width: 0;
}

.goticketing-group-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: block;
}

.goticketing-group-description {
    font-size: 12px;
    color: #666;
    display: block;
    margin-top: 2px;
}

.goticketing-group-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    flex-shrink: 0;
}

.goticketing-group-plans {
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
}

/* ========================================
   Ungrouped Plans
   ======================================== */
.goticketing-ungrouped-plans {
    margin-top: 10px;
}

.goticketing-ungrouped-header {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    padding: 6px 0;
    margin-bottom: 6px;
    border-bottom: 1px solid #eee;
}

/* ========================================
   Plan Row - iaBilet Design
   ======================================== */
.goticketing-plan-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.goticketing-plan-row:last-child {
    border-bottom: none;
}

.goticketing-plan-row:hover:not(.goticketing-plan-expired):not(.goticketing-plan-future):not(.goticketing-plan-unavailable) {
    background: #fafbfc;
}

/* Plan Status Variants */
.goticketing-plan-row.goticketing-plan-expired {
    background: #fef5f5;
    opacity: 0.7;
}

.goticketing-plan-row.goticketing-plan-future {
    background: #f5fef8;
    opacity: 0.85;
}

.goticketing-plan-row.goticketing-plan-unavailable {
    background: #f9f9f9;
    opacity: 0.7;
}

/* Plan Left Side - Title + Description (gap controlled by Elementor "Plan Left Gap") */
.goticketing-plan-left {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.goticketing-plan-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin-bottom: 0;
}

.goticketing-plan-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
    background: #f0f0f0;
    color: #666;
}

.goticketing-plan-expired .goticketing-plan-badge {
    background: #fee;
    color: #c00;
}

.goticketing-plan-future .goticketing-plan-badge {
    background: #e8f5e9;
    color: #2e7d32;
}

.goticketing-plan-unavailable .goticketing-plan-badge {
    background: #f5f5f5;
    color: #999;
}

.goticketing-plan-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.goticketing-plan-stock-warning {
    font-size: 12px;
    color: #e67700;
    margin-top: 0;
    font-weight: 500;
}

/* Plan Right Side - Prices + Quantity */
.goticketing-plan-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Prices Section */
.goticketing-plan-prices {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-align: right;
}

.goticketing-price-regular {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.goticketing-price-regular sup {
    font-size: 10px;
    margin-left: 1px;
}

.goticketing-price-current {
    font-size: 18px;
    font-weight: 700;
    color: #e53935;
}

.goticketing-price-current sup {
    font-size: 11px;
    margin-left: 1px;
    font-weight: 600;
}

.goticketing-plan-disabled {
    font-size: 18px;
    color: #ccc;
    padding: 0 12px;
}

.goticketing-plan-remaining {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

.goticketing-plan-period {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

/* ========================================
   Quantity Selector - iaBilet Style
   ======================================== */
.goticketing-qty-selector {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
}

.goticketing-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.goticketing-qty-minus {
    background: #26a69a;
    color: #fff;
}

.goticketing-qty-minus:hover:not(:disabled) {
    background: #00897b;
}

.goticketing-qty-plus {
    background: #26a69a;
    color: #fff;
}

.goticketing-qty-plus:hover:not(:disabled) {
    background: #00897b;
}

.goticketing-qty-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.goticketing-qty-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.goticketing-qty-input {
    width: 32px;
    height: 28px;
    border: none;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    -moz-appearance: textfield;
    padding: 0;
    margin: 0;
    background: transparent;
    color: #333;
}

.goticketing-qty-input::-webkit-outer-spin-button,
.goticketing-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.goticketing-qty-input:focus {
    outline: none;
}

/* ========================================
   Widget Footer - Total & Add to Cart
   ======================================== */
.goticketing-widget-footer {
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.goticketing-footer-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.goticketing-total-items {
    font-size: 14px;
    color: #666;
}

.goticketing-total-price {
    font-size: 20px;
    font-weight: 700;
    color: #e53935;
}

.goticketing-no-selection {
    font-size: 14px;
    color: #999;
    font-style: italic;
}

/* Add to Cart Button */
.goticketing-add-all-btn {
    padding: 12px 28px;
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 160px;
}

.goticketing-add-all-btn:hover:not(:disabled) {
    background: #c62828;
}

.goticketing-add-all-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.goticketing-add-all-btn:disabled,
.goticketing-add-all-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
}

.goticketing-add-all-btn.loading {
    pointer-events: none;
}

.goticketing-add-all-btn .goticketing-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: goticketing-spin 0.8s linear infinite;
}

/* Widget Message */
.goticketing-widget-message {
    width: 100%;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    margin-top: 12px;
}

.goticketing-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.goticketing-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* ========================================
   Responsive - Mobile
   ======================================== */
@media (max-width: 600px) {
    /* Booking calendar: 100% screen width on mobile when choosing date */
    .goticketing-booking-calendar-widget {
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(-50vw + 50%);
        padding-left: 10px;
        padding-right: 10px;
        box-sizing: border-box;
    }
    .goticketing-booking-calendar-widget .goticketing-booking-calendar,
    .goticketing-calendar-reselect-wrapper .goticketing-booking-calendar {
        width: 100%;
        max-width: 100%;
    }
    .goticketing-calendar-grid-wrapper {
        overflow: visible;
        padding: 0;
        width: 100%;
        max-width: 100%;
    }
    .goticketing-calendar-grid {
        padding: 10px;
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
    .goticketing-calendar-weekdays,
    .goticketing-calendar-week {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 2px;
        margin-bottom: 2px;
    }
    .goticketing-calendar-weekday {
        font-size: 9px;
    }
    .goticketing-calendar-day {
        min-height: 0;
        aspect-ratio: 1;
        font-size: 11px;
    }
    .goticketing-calendar-day-price {
        font-size: 8px;
    }
    .goticketing-calendar-nav {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    .goticketing-calendar-header {
        padding: 8px 10px;
    }

    /* Reselect calendar (Change date) also full width */
    .goticketing-calendar-reselect-wrapper {
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(-50vw + 50%);
        padding-left: 10px;
        padding-right: 10px;
        box-sizing: border-box;
    }

    .goticketing-plan-row {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }
    
    .goticketing-plan-left {
        padding-right: 0;
        width: 100%;
    }
    
    .goticketing-plan-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .goticketing-plan-title {
        font-size: 14px;
    }
    
    .goticketing-plan-desc {
        font-size: 12px;
    }
    
    .goticketing-price-current {
        font-size: 16px;
    }
    
    .goticketing-widget-footer {
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
    }
    
    .goticketing-footer-summary {
        width: 100%;
        justify-content: space-between;
    }
    
    .goticketing-add-all-btn {
        width: 100%;
    }
    
    .goticketing-quick-links {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
}

/* ========================================
   Without Groups - Direct Plan List
   ======================================== */
.goticketing-ungrouped-plans > .goticketing-plan-row:first-child {
    border-top: 1px solid #e0e0e0;
    border-radius: 6px 6px 0 0;
}

.goticketing-ungrouped-plans > .goticketing-plan-row:last-child {
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0 0 6px 6px;
}

.goticketing-ungrouped-plans > .goticketing-plan-row:only-child {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.goticketing-ungrouped-plans > .goticketing-plan-row {
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
}

/* ========================================
   Booking Calendar (Monday-first, polished design)
   ======================================== */
.goticketing-booking-calendar-widget {
    padding: 10px;
}

.goticketing-calendar-intro {
    margin: 0 0 10px 0;
    color: #4a5568;
    font-size: 15px;
    line-height: 1.5;
}

.goticketing-booking-calendar {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.goticketing-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.goticketing-calendar-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.goticketing-calendar-nav {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s ease;
}

.goticketing-calendar-nav:hover {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.goticketing-calendar-loading {
    padding: 32px;
    text-align: center;
}

.goticketing-calendar-grid {
    padding: 10px;
}

.goticketing-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    margin-bottom: 6px;
}

.goticketing-calendar-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.goticketing-calendar-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    margin-bottom: 2px;
}

.goticketing-calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 8px;
    min-height: 48px;
    transition: all 0.15s ease;
}

.goticketing-calendar-day.other-month {
    color: #cbd5e1;
}

.goticketing-calendar-day.past {
    color: #cbd5e1;
}

.goticketing-calendar-day.clickable {
    cursor: pointer;
    background: #f8fafc;
}

.goticketing-calendar-day.clickable:hover {
    background: #e0f2fe;
    transform: scale(1.02);
}

.goticketing-calendar-day.selected {
    background: #0073aa;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.35);
}

.goticketing-calendar-day.selected .goticketing-calendar-day-price {
    color: rgba(255, 255, 255, 0.95);
}

.goticketing-calendar-day.today:not(.selected) {
    border: 2px solid #0073aa;
    background: #f0f9ff;
}

.goticketing-calendar-day-num {
    font-weight: 600;
}

.goticketing-calendar-day-price {
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}

.goticketing-calendar-day.weekend {
    background: #faf5f5;
}

.goticketing-calendar-day.weekend.clickable {
    background: #faf5f5;
}

.goticketing-calendar-day.weekend.clickable:hover {
    background: #fce7e7;
}

.goticketing-calendar-day.weekend.selected {
    background: #0073aa;
}

/* Calendar Today / Clear buttons */
.goticketing-calendar-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-top: 4px;
    border-top: 1px solid #e2e8f0;
    background: #fafbfc;
}

.goticketing-calendar-action-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.goticketing-calendar-clear-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.goticketing-calendar-clear-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.goticketing-calendar-today-btn {
    background: #0073aa;
    border: 1px solid #0073aa;
    color: #fff;
}

.goticketing-calendar-today-btn:hover {
    background: #005a87;
    border-color: #005a87;
}

.goticketing-calendar-fallback {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.goticketing-calendar-fallback .goticketing-date-label {
    margin: 0;
    font-weight: 500;
    color: #475569;
}

.goticketing-calendar-fallback .goticketing-date-input,
.goticketing-date-reselect-input {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.goticketing-calendar-fallback .goticketing-date-input:focus,
.goticketing-date-reselect-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

/* Inline calendar when changing date */
.goticketing-calendar-reselect-wrapper {
    margin-bottom: 20px;
}

.goticketing-calendar-reselect-wrapper .goticketing-booking-calendar {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Date reselection (when plans are shown) */
.goticketing-date-reselect-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
}

.goticketing-date-reselect-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.goticketing-date-reselect-label {
    color: #475569;
    font-weight: 500;
}

.goticketing-date-reselect-value {
    color: #1e293b;
    font-weight: 600;
}

.goticketing-date-reselect-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.goticketing-date-reselect-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.goticketing-date-reselect-btn:hover {
    background: #f8fafc;
    border-color: #0073aa;
    color: #0073aa;
}

.goticketing-change-date-btn {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    font-weight: 500;
}

.goticketing-change-date-btn:hover {
    background: #005a87;
    border-color: #005a87;
    color: #fff;
}

.goticketing-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
