/* Flor y Estilo Delivery - Variations as Buttons + Calendar */

/* ============ VARIATIONS SWATCHES ============ */
.woocommerce div.product form.cart .variations {
    width: 100%;
    border: none;
    margin-bottom: 16px;
}
.woocommerce div.product form.cart .variations td,
.woocommerce div.product form.cart .variations th {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
}
.woocommerce div.product form.cart .variations .label {
    margin-bottom: 8px;
}
.woocommerce div.product form.cart .variations .label label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #333;
}
.woocommerce div.product form.cart .variations td.value {
    margin-bottom: 16px;
}
/* Hide the native select */
.woocommerce div.product form.cart .variations td.value select {
    display: none !important;
}
/* Swatch buttons container */
.fsd-swatch-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.fsd-swatch-btn {
    padding: 10px 20px;
    border: 2px solid #E8E6E3;
    background: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Nunito Sans', sans-serif;
    color: #333;
    transition: all 0.15s;
    text-align: center;
    min-width: 60px;
}
.fsd-swatch-btn:hover {
    border-color: #DC2698;
    color: #DC2698;
}
.fsd-swatch-btn.active {
    background: #DC2698;
    color: #fff;
    border-color: #DC2698;
}
.fsd-swatch-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    text-decoration: line-through;
}
/* Color swatch (if attribute looks like a color) */
.fsd-swatch-btn.fsd-color-swatch {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    position: relative;
}
.fsd-swatch-btn.fsd-color-swatch.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
/* Reset link */
.woocommerce div.product form.cart .variations .reset_variations {
    font-size: 0.75rem;
    color: #DC2698;
    margin-top: 8px;
    display: inline-block;
    visibility: visible !important;
}

/* Single variation wrap (price + add to cart) */
.woocommerce div.product form.cart .single_variation_wrap {
    margin-top: 16px;
}
.woocommerce div.product form.cart .single_variation .price {
    font-size: 1.4rem !important;
    margin-bottom: 16px;
}

/* Quantity + Add to Cart row */
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============ FRONTEND CALENDAR ============ */
.fsd-delivery-picker {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid #E8E6E3;
    background: #fff;
    font-family: 'Nunito Sans', -apple-system, sans-serif;
    width: 100%;
    flex-basis: 100%;
    order: 99;
}

/* Force WC form to wrap so calendar goes full width and qty/button go below */
.woocommerce div.product form.cart {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px;
    align-items: flex-start;
}
.woocommerce div.product form.cart .quantity {
    order: 100;
}
.woocommerce div.product form.cart .single_add_to_cart_button {
    order: 101;
}
.fsd-delivery-title {
    font-family: 'Nunito Sans', -apple-system, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #333;
}

/* Calendar Navigation */
.fsd-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.fsd-cal-nav-btn {
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid #E8E6E3;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #333;
}
.fsd-cal-nav-btn:hover {
    background: #DC2698;
    color: #fff;
    border-color: #DC2698;
}
.fsd-cal-month {
    font-size: 1rem;
    font-weight: 700;
    text-transform: capitalize;
}

/* Calendar Grid */
.fsd-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.fsd-cal-grid .fsd-cal-header {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    padding: 6px 0;
}
.fsd-cal-grid .fsd-day {
    text-align: center;
    padding: 10px 2px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    position: relative;
}
.fsd-cal-grid .fsd-day:hover:not(.fsd-day-disabled):not(.fsd-day-empty) {
    background: #FDF2F5;
    border-color: #DC2698;
}
.fsd-cal-grid .fsd-day.fsd-day-selected {
    background: #DC2698;
    color: #fff;
    font-weight: 700;
}
.fsd-cal-grid .fsd-day.fsd-day-disabled {
    color: #ccc;
    cursor: default;
}
.fsd-cal-grid .fsd-day.fsd-day-empty {
    cursor: default;
}
.fsd-cal-grid .fsd-day.fsd-day-today::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #DC2698;
}

/* Slot Picker */
.fsd-slot-picker {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E8E6E3;
}
.fsd-slot-label {
    font-size: 0.82rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: #333;
}
.fsd-slot-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.fsd-slot-btn {
    padding: 10px 18px;
    border: 1px solid #E8E6E3;
    background: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Nunito Sans', sans-serif;
    transition: all 0.15s;
    color: #333;
}
.fsd-slot-btn:hover:not(.fsd-slot-disabled) {
    border-color: #DC2698;
    color: #DC2698;
}
.fsd-slot-btn.fsd-slot-selected {
    background: #DC2698;
    color: #fff;
    border-color: #DC2698;
}
.fsd-slot-btn.fsd-slot-disabled {
    color: #ccc;
    cursor: default;
    background: #f9f9f9;
}

/* Delivery Summary */
.fsd-delivery-summary {
    margin-top: 14px;
    padding: 12px 16px;
    background: #FDF2F5;
    font-size: 0.85rem;
    color: #333;
    border-left: 3px solid #DC2698;
}
.fsd-delivery-summary strong {
    color: #DC2698;
}

/* Validation message */
.fsd-validation-msg {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 8px;
    display: none;
}
.fsd-validation-msg.show {
    display: block;
}

/* ============ PRODUCT SIDEBAR (reserved for future) ============ */
/* Currently sidebar is in cart, not product page */
.fsd-product-sidebar { display: none; }
.fsd-product-sidebar-unused {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid #E8E6E3;
    background: #FAFAF8;
    font-family: 'Nunito Sans', -apple-system, sans-serif;
}
.fsd-sidebar-title {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #333;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.fsd-sidebar-section {
    padding: 16px 0;
    border-top: 1px solid #E8E6E3;
}
.fsd-sidebar-section:first-child {
    padding-top: 0;
    border-top: none;
}

/* Selection summary */
.fsd-selection-summary {
    padding-bottom: 16px;
}
.fsd-summary-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fsd-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #666;
}
.fsd-summary-item span:last-child {
    font-weight: 600;
    color: #333;
}
.fsd-summary-item.fsd-summary-delivery {
    color: #DC2698;
}
.fsd-summary-item.fsd-summary-delivery span:last-child {
    color: #DC2698;
}

/* Comuna select */
.fsd-sidebar-select {
    width: 100%;
    padding: 12px 32px 12px 14px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 0.85rem;
    color: #333;
    outline: none;
    -webkit-appearance: none;
    background: #fff url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") calc(100% - 12px) center / 10px no-repeat;
}
.fsd-sidebar-select:focus {
    border-color: #DC2698;
    box-shadow: 0 0 0 1px #DC2698;
}
.fsd-shipping-result {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #E8E6E3;
}
.fsd-shipping-result span:last-child {
    font-weight: 700;
    color: #DC2698;
}

/* Notes */
.fsd-sidebar-details summary {
    font-size: 0.82rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    list-style: none;
}
.fsd-sidebar-details summary::-webkit-details-marker { display: none; }
.fsd-sidebar-details summary::before { content: '+ '; color: #DC2698; }
.fsd-sidebar-details[open] summary::before { content: '− '; }
.fsd-sidebar-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 60px;
    outline: none;
    margin-top: 10px;
    box-sizing: border-box;
}
.fsd-sidebar-textarea:focus { border-color: #DC2698; }

/* Document type */
.fsd-doc-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.fsd-doc-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    background: #fff;
    transition: border-color 0.15s;
}
.fsd-doc-btn:hover { border-color: #DC2698; }
.fsd-doc-btn input[type="radio"] { accent-color: #DC2698; margin: 0; }
.fsd-doc-btn input[type="radio"]:checked + span { color: #DC2698; }

.fsd-factura-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fsd-sidebar-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}
.fsd-sidebar-input:focus { border-color: #DC2698; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .fsd-product-sidebar {
        margin-top: 20px;
        padding: 18px;
    }
}
