/**
 * YSF Custom Bundle - Frontend Styles
 */

/* Teaser */
.ysf-bundle-teaser {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: #ebfdf8;
    border-radius: 8px;
    margin-bottom: 12px;
    font-family: "futura-pt", sans-serif;
    font-size: 1rem;
    font-weight: 450;
    line-height: 1.4;
    color: #008447;
}

.ysf-bundle-teaser__icon {
    flex-shrink: 0;
    margin-top: 1px;
    color: #008447;
}

.ysf-bundle-teaser strong {
    font-weight: 700;
}

/* Container */
.ysf-bundle-container {
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: #ffecfc;
}

/* Header – collapsible toggle */
.ysf-bundle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    gap: 12px;
}

.ysf-bundle-header[aria-expanded="true"] {
    margin-bottom: 1rem;
}

.ysf-bundle-header__icon {
    flex-shrink: 0;
    color: #111827;
}

.ysf-bundle-chevron {
    flex-shrink: 0;
    transition: transform 0.25s ease;
    color: #111827;
}

.ysf-bundle-header[aria-expanded="true"] .ysf-bundle-chevron {
    transform: rotate(90deg);
}

.ysf-bundle-title {
    margin: 0 !important;
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    position: relative;
    flex: 1;
    padding: 0 !important;
}
.ysf-bundle-title .ysf-bundle-info-icon {
    position: relative;
    bottom: -4px;
    margin-left: .5rem;
    height: 10px;
}

.ysf-bundle-description {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

.ysf-bundle-announcement {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #ebfdf8;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    color: #008447;
    text-align: center;
}

/* Products List */
.ysf-bundle-products {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Individual Product Item */
.ysf-bundle-item {
transition: all 0.2s ease;
    padding: 16px 0;
}



/* Checkbox Label */
.ysf-bundle-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

/* Hide default checkbox */
.ysf-bundle-checkbox {
    display: none;
    visibility: hidden;
}

/* Custom Checkbox Styling */
.ysf-checkbox-custom {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: none;
    flex-shrink: 0;
    vertical-align: middle;
    transform: scale(1);
    transition: all 0.2s ease;
    background: #fff;
}

.ysf-checkbox-custom svg {
    position: absolute;
    top: 3px;
    left: 2px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 16px;
    stroke-dashoffset: 16px;
    transition: all 0.3s ease;
    transition-delay: 0.1s;
    transform: translate3d(0, 0, 0);
}

.ysf-checkbox-custom:before {
    content: "";
    width: 100%;
    height: 100%;
    background: #13e7ac;
    display: block;
    transform: scale(0);
    opacity: 1;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Hover state */
.ysf-bundle-checkbox-label:hover .ysf-checkbox-custom {
    border-color: #13e7ac;
}

/* Checked state */
.ysf-bundle-checkbox:checked + .ysf-checkbox-custom {
    background: #13e7ac;
    border-color: #13e7ac;
    animation: ysf-checkbox-wave 0.4s ease;
}

.ysf-bundle-checkbox:checked + .ysf-checkbox-custom svg {
    stroke-dashoffset: 0;
}

.ysf-bundle-checkbox:checked + .ysf-checkbox-custom:before {
    transform: scale(3.5);
    opacity: 0;
    transition: all 0.6s ease;
}

@keyframes ysf-checkbox-wave {
    50% {
        transform: scale(0.9);
    }
}

/* Product Image */
.ysf-bundle-product-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;

}

.ysf-bundle-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Product Info */
.ysf-bundle-product-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.ysf-bundle-product-name {
    font-weight: 500;
    color: #111827;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ysf-bundle-variation-count {
    font-weight: 400;
    font-size: 0.75rem;
    color: #111827;

}

.ysf-bundle-product-price {
    color: #111827;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: right;
}

.ysf-bundle-product-price .wc-gzd-sale-price-label,
.ysf-bundle-product-price .wc-gzd-sale-price-regular-label {
    display: none;
}

.ysf-bundle-product-price del {
    display: none;
    color: #33333380;
}

/* Item Details (Variations & Quantity) */
.ysf-bundle-item-details {
    margin-top: 0.875rem;
    padding-top: 0.875rem;

}

/* Variations */
.ysf-bundle-variations {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ysf-bundle-variation-field {
    display: flex;
    flex-direction: column;
}

.ysf-bundle-variation-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.ysf-bundle-variation-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;

    font-size: 0.875rem;
    background: #ffffff;
    transition: border-color 0.15s ease;
}

.ysf-bundle-variation-select:focus {
    outline: none;
    border-color: #374151;

}

/* Messages */
.ysf-bundle-messages {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.ysf-bundle-messages p {
    margin: 0;
}

.ysf-bundle-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.ysf-bundle-success {
    background: #ebfdf8;
    color: #008447;
}

/* Loading State */
.ysf-bundle-container .button.loading {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.ysf-bundle-container .button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: ysf-bundle-spin 0.6s linear infinite;
}

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

/* Responsive */
@media (min-width: 640px) {
    .ysf-bundle-product-info {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
    }

    .ysf-bundle-variation-field {
        flex-direction: row;
        align-items: center;
    }

    .ysf-bundle-variation-field label {
        width: 120px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .ysf-bundle-variation-select {
        flex: 1;
    }
}

/* Theme Compatibility */
.woocommerce .ysf-bundle-container,
.woocommerce-page .ysf-bundle-container {
    clear: both;
}

/* Ensure proper spacing with WooCommerce form */
.ysf-bundle-container + form.cart {
    margin-top: 0;
}



/* ------ SAVINGS SECTION ------ */
.ysf-bundle-calculator {
    background: inherit;
    border: none;
    border-radius: 5px;
    margin: 1rem 0;
    padding: 20px 20px 20px 32px;
    text-align: right;
}

.ysf-bundle-calculator .row {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 2rem;
}

.calculator-icon {
    font-size: 2rem;
    display: inline-block;
    vertical-align: middle;
}
.calculator-values {
    display: inline-block;
    vertical-align: middle;
    text-align: right;
    margin-left: auto;
}

.savings-display {
    font-size: 1.3em;
    font-weight: 500;
    color: #000000;
}

.savings-amount {
  
}

.savings-percentage {
    margin-left: 8px;
}

.bundle-total {
    font-size: 0.95rem;
    color: #000000;
}

.bundle-total .total-text {

}
.bundle-total .total-amount {
    font-weight: 500;
    font-size: 1rem;
    color: #000000;
}

@media(max-width: 480px) {
    .ysf-bundle-calculator {
        padding: 1rem 1.5rem;
    }
    .savings-display {
        font-size: 1.25rem;
    }
}

/* Message styling */
.ysf-bundle-message {
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

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

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

/* ------ PRODUCT INFO ICON & MODAL ------ */
/* Price wrapper with info icon */
.ysf-bundle-product-price-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Info icon button */
.ysf-bundle-info-icon {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    margin: 0;
}

.ysf-bundle-info-icon:hover {
    transform: scale(1.1);
    opacity: 0.8;
    background-color: transparent !important
}

.ysf-bundle-info-icon:focus {
    outline: 2px solid #111827;
    outline-offset: 2px;
    border-radius: 50%;
}

.ysf-bundle-info-icon svg {
    display: block;
    width: 24px;
    height: 24px;
}

/* Modal specific styles */
.ysf-bundle-modal-image {
    margin-bottom: 1.5rem;
    text-align: center;
}

.ysf-bundle-modal-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.ysf-bundle-modal-description {
    margin-bottom: 1.5rem;
    line-height: 1.5;
    color: #374151;
    font-size: 1rem;
    max-height: calc(1.5em * 7);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
}

.ysf-bundle-modal-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.ysf-bundle-modal-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;

    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    font-size: 1rem;
    transition: background 0.2s ease;
    text-align: center;
    background-color: #13e7ac !important;
        color: #17181b !important;
        width: 100%;
    
}

.ysf-bundle-modal-button:hover {
    background: #111827;
    color: #ffffff !important;
}