/**
 * Merch.com Smart Bundler - Frontend Styles
 *
 * @author Abdulla Darwish
 * @package Merch_Smart_Bundler
 */

/* ============================================
   Short Description - Modern Bundle Box
   ============================================ */
.cfsb-bundle-box,
.cfsb-short-summary {
    margin-top: 18px;
    margin-bottom: 22px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
    font-family: inherit;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
}

/* Header */
.cfsb-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #edf2f7;
}

.cfsb-header-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cfsb-header-icon {
    display: inline-flex;
    align-items: center;
    color: #4f46e5;
}

.cfsb-header-icon svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
}

.cfsb-header-title,
.cfsb-summary-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.cfsb-header-count-badge,
.cfsb-summary-count {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 2px 9px;
    border-radius: 12px;
    line-height: 1.3;
}

/* Discount Ribbon */
.cfsb-discount-ribbon,
.cfsb-summary-discount-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: #f0fdf4;
    border-bottom: 1px solid #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 600;
}

.cfsb-ribbon-icon,
.cfsb-discount-icon {
    display: flex;
    align-items: center;
    color: #16a34a;
    flex-shrink: 0;
}

.cfsb-ribbon-icon svg,
.cfsb-discount-icon svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}

.cfsb-ribbon-content {
    flex: 1;
    line-height: 1.4;
}

.cfsb-ribbon-tag {
    display: inline-block;
    background: #16a34a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.cfsb-savings-live {
    color: #15803d;
    font-weight: 800;
}

/* Items Container */
.cfsb-items-container {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
}

/* Bundle Row Item Card */
.cfsb-bundle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.cfsb-bundle-row:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

/* Thumbnail */
.cfsb-row-thumb-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.cfsb-row-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.cfsb-bundle-row:hover .cfsb-row-thumb {
    transform: scale(1.05);
}

.cfsb-row-qty {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 0 4px;
    border-radius: 3px;
    line-height: 13px;
}

/* Details */
.cfsb-row-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cfsb-row-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cfsb-row-title-link {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: #1e293b;
    transition: color 0.15s;
}

.cfsb-row-title-link:hover {
    color: #4f46e5;
}

.cfsb-row-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cfsb-row-arrow {
    display: inline-flex;
    opacity: 0.35;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
    color: #4f46e5;
}

.cfsb-row-arrow svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
}

.cfsb-row-title-link:hover .cfsb-row-arrow {
    opacity: 1;
    transform: translateY(-1px);
}

.cfsb-row-price {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

/* Select Row */
.cfsb-row-select-wrap {
    width: 100%;
    position: relative;
}

.cfsb-item-var-select {
    width: 100%;
    height: 30px;
    padding: 0 26px 0 8px;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 8px center;
    background-size: 13px;
}

.cfsb-item-var-select:hover {
    border-color: #94a3b8;
}

.cfsb-item-var-select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

/* ============================================
   Compact, Professional Cart Table Styles
   ============================================ */
.cfsb-cart-pill {
    display: inline-flex;
    align-items: center;
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
    line-height: 1.4;
    white-space: nowrap;
}

.cfsb-cart-locked-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    color: #0f172a;
    box-sizing: border-box;
    text-align: center;
}

.cfsb-cart-price-wrap {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}

.cfsb-cart-del {
    color: #94a3b8 !important;
    font-size: 12px;
    margin-left: 4px;
    text-decoration: line-through;
}

.cfsb-cart-ins {
    color: #16a34a !important;
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
}

.cfsb-bundle-cart-item {
    background-color: rgba(248, 250, 252, 0.4) !important;
}

.cfsb-archive-discount-badge {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
    vertical-align: middle;
}

/* Notice box */
.cfsb-notice-box {
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.cfsb-notice-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* ============================================
   Long Description - Bundle Products Cards
   ============================================ */
.cfsb-desc-bundle-section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1.5px solid #e2e8f0;
}

.cfsb-desc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.cfsb-desc-icon {
    display: flex;
    align-items: center;
}

.cfsb-desc-icon svg {
    stroke: #4f46e5;
}

.cfsb-desc-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    flex: 1;
}

.cfsb-desc-count {
    font-size: 11px;
    color: #4f46e5;
    background: #eef2ff;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.cfsb-desc-products {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cfsb-desc-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}

.cfsb-desc-card:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.cfsb-desc-card-img-link {
    flex-shrink: 0;
    display: block;
}

.cfsb-desc-card-img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.cfsb-desc-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.cfsb-desc-card-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.cfsb-desc-card-name:hover {
    color: #4f46e5;
}

.cfsb-desc-card-link-icon {
    display: inline-flex;
    opacity: 0.4;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.cfsb-desc-card-link-icon svg {
    width: 13px;
    height: 13px;
    stroke: #4f46e5;
}

.cfsb-desc-card-name:hover .cfsb-desc-card-link-icon {
    opacity: 1;
}

.cfsb-desc-card-attr {
    font-size: 11px;
    color: #4338ca;
    background: #e0e7ff;
    padding: 2px 7px;
    border-radius: 4px;
    display: inline-block;
    max-width: fit-content;
    font-weight: 600;
}

.cfsb-desc-card-excerpt {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.4;
    margin: 2px 0 0;
}

.cfsb-desc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #f1f5f9;
}

.cfsb-desc-card-qty {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 600;
}

.cfsb-desc-card-price {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

/* Responsive */
@media (max-width: 768px) {
    .cfsb-bundle-row {
        padding: 8px;
        gap: 10px;
    }

    .cfsb-row-thumb-wrap {
        width: 44px;
        height: 44px;
    }

    .cfsb-desc-card {
        gap: 10px;
        padding: 10px;
    }

    .cfsb-desc-card-img {
        width: 56px;
        height: 56px;
    }
}
