/**
 * Bundle Builder - CSS Styles
 * Estilos para todos los templates de bundles
 * 
 * @package COD_Form_Builder_Pro
 * @since 7.3.0
 */

/* ========================================
   BASE STYLES
   ======================================== */

.cod-bundle {
    font-family: var(--bundle-title-font, 'Inter', sans-serif);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.cod-bundle-header {
    padding: 12px 16px;
    border-bottom: 1px dashed var(--bundle-border, #e5e7eb);
}

.cod-bundle-title {
    font-family: var(--bundle-header-font, 'Inter', sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--bundle-header, #111827);
}

/* ========================================
   TEMPLATE 1: CLASSIC LIST
   ======================================== */

.cod-bundle-classic {
    background: var(--bundle-bg, #ffffff);
    border: 2px solid var(--bundle-border, #e5e7eb);
}

.cod-bundle-offers {
    padding: 8px;
}

.cod-bundle-offer {
    position: relative;
    background: var(--bundle-bg, #ffffff);
    border: 2px solid var(--bundle-border, #e5e7eb);
    border-radius: 12px;
    margin-bottom: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cod-bundle-offer:hover {
    border-color: var(--bundle-highlight, #8b5cf6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cod-bundle-offer.selected {
    background: var(--bundle-selected-bg, #f3e8ff);
    border-color: var(--bundle-selected-border, #8b5cf6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.cod-bundle-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.cod-bundle-offer-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cod-bundle-radio {
    position: relative;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.cod-bundle-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.cod-bundle-checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    background: #ffffff;
    border: 2px solid var(--bundle-border, #d1d5db);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cod-bundle-radio input:checked~.cod-bundle-checkmark {
    background: var(--bundle-highlight, #8b5cf6);
    border-color: var(--bundle-highlight, #8b5cf6);
}

.cod-bundle-checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cod-bundle-radio input:checked~.cod-bundle-checkmark:after {
    display: block;
}

.cod-bundle-offer-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--bundle-border, #e5e7eb);
}

.cod-bundle-offer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cod-bundle-offer-content {
    flex: 1;
    min-width: 0;
}

.cod-bundle-offer-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--bundle-title, #374151);
    margin-bottom: 2px;
}

.cod-bundle-offer-subtitle {
    font-size: 13px;
    color: var(--bundle-subtitle, #6b7280);
}

.cod-bundle-offer-pricing {
    text-align: right;
    flex-shrink: 0;
}

.cod-bundle-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--bundle-price, #111827);
}

.cod-bundle-compared-price {
    font-size: 14px;
    color: var(--bundle-compared-price, #ef4444);
    text-decoration: line-through;
}

/* Timer */
.cod-bundle-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    margin: 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.cod-bundle-timer-countdown {
    font-family: 'SF Mono', Monaco, monospace;
    font-weight: 700;
    background: #92400e;
    color: #fef3c7;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Free Gift */
.cod-bundle-free-gift {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    margin: 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #166534;
}

/* Shipping Protection */
.cod-bundle-shipping-protection {
    padding: 12px 16px;
    margin: 8px;
    background: #f0fdf4;
    border-radius: 8px;
    border: 1px solid #86efac;
}

.cod-bundle-shipping-protection label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #166534;
}

.cod-bundle-shipping-protection input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #22c55e;
}

.cod-protection-price {
    margin-left: auto;
    font-weight: 700;
}

/* ========================================
   TEMPLATE 2: MODERN CARDS
   ======================================== */

.cod-bundle-cards {
    background: var(--bundle-bg, #ffffff);
}

.cod-bundle-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
}

.cod-bundle-card {
    position: relative;
    background: #ffffff;
    border: 2px solid var(--bundle-border, #e5e7eb);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cod-bundle-card:hover {
    border-color: var(--bundle-highlight, #22c55e);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cod-bundle-card.selected {
    border-color: var(--bundle-selected-border, #22c55e);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.cod-bundle-card-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #22c55e;
    color: white;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

.cod-bundle-card-header {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.cod-bundle-card-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.cod-bundle-card-extras {
    font-size: 11px;
    color: #ec4899;
    font-weight: 600;
    margin-bottom: 12px;
}

.cod-bundle-card-price {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
}

.cod-bundle-card-compared {
    font-size: 14px;
    color: #ef4444;
    text-decoration: line-through;
}

/* Responsive cards */
@media (max-width: 480px) {
    .cod-bundle-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   TEMPLATE 3: COMPACT ROWS
   ======================================== */

.cod-bundle-rows {
    background: var(--bundle-bg, #ffffff);
    border: 2px solid var(--bundle-border, #e5e7eb);
    border-radius: 12px;
}

.cod-bundle-rows-list {
    padding: 8px;
}

.cod-bundle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cod-bundle-row:hover {
    background: #f9fafb;
}

.cod-bundle-row.selected {
    background: #eff6ff;
    border-color: var(--bundle-selected-border, #3b82f6);
}

.cod-bundle-row-radio input {
    width: 20px;
    height: 20px;
    accent-color: var(--bundle-highlight, #3b82f6);
}

.cod-bundle-row-image {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.cod-bundle-row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cod-bundle-row-content {
    flex: 1;
    min-width: 0;
}

.cod-bundle-row-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.cod-bundle-row-subtitle {
    font-size: 12px;
    color: #6b7280;
}

.cod-bundle-row-pricing {
    text-align: right;
}

.cod-bundle-row-price {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.cod-bundle-row-compared {
    font-size: 12px;
    color: #ef4444;
    text-decoration: line-through;
}

.cod-bundle-row-badge {
    background: #854d0e;
    color: #fef3c7;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ========================================
   TEMPLATE 4: PRODUCT COMBO
   ======================================== */

.cod-bundle-combo {
    background: var(--bundle-bg, #f3e8ff);
    border: 2px solid var(--bundle-border, #8b5cf6);
    border-radius: 16px;
    padding: 16px;
}

.cod-bundle-combo-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.cod-bundle-combo-radio input {
    width: 22px;
    height: 22px;
    accent-color: #8b5cf6;
}

.cod-bundle-combo-info {
    flex: 1;
}

.cod-bundle-combo-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.cod-bundle-combo-savings {
    font-size: 13px;
    color: #059669;
    font-weight: 600;
}

.cod-bundle-combo-total {
    text-align: right;
}

.cod-bundle-combo-price {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
}

.cod-bundle-combo-compared {
    font-size: 14px;
    color: #ef4444;
    text-decoration: line-through;
}

.cod-bundle-combo-products {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cod-bundle-combo-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #8b5cf6;
    color: white;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    margin-top: 30px;
}

.cod-bundle-combo-product {
    text-align: center;
    max-width: 100px;
}

.cod-bundle-combo-product-image {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 8px;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    border: 2px solid #e5e7eb;
}

.cod-bundle-combo-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cod-bundle-combo-qty {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #8b5cf6;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.cod-bundle-combo-product-name {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.cod-bundle-combo-product-price {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.cod-bundle-combo-product-compared {
    font-size: 11px;
    color: #ef4444;
    text-decoration: line-through;
}

/* ========================================
   TEMPLATE 5: SUBSCRIPTION BOX
   ======================================== */

.cod-bundle-subscription {
    background: var(--bundle-bg, #fff7ed);
    border: 2px solid var(--bundle-border, #f97316);
    border-radius: 12px;
    padding: 16px;
}

.cod-bundle-subscription-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.cod-bundle-subscription-checkbox input {
    width: 20px;
    height: 20px;
    accent-color: #f97316;
    margin-top: 2px;
}

.cod-bundle-subscription-info {
    flex: 1;
}

.cod-bundle-subscription-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.cod-bundle-subscription-subtitle {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.cod-bundle-subscription-frequency select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background: white;
    cursor: pointer;
}

.cod-bundle-subscription-frequency select:focus {
    outline: none;
    border-color: #f97316;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 480px) {
    .cod-bundle-offer-inner {
        flex-wrap: wrap;
    }

    .cod-bundle-offer-pricing {
        width: 100%;
        text-align: left;
        margin-top: 8px;
        padding-left: 36px;
    }

    .cod-bundle-combo-products {
        gap: 4px;
    }

    .cod-bundle-combo-product {
        max-width: 70px;
    }

    .cod-bundle-combo-product-image {
        width: 60px;
        height: 60px;
    }
}