/* Storefront modals — quick view + cart item edit */
.sf-modal__dialog {
    position: relative;
    overflow: hidden;
}

.sf-modal__dialog::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #434C83 0%, #5B66A8 55%, #CE1D89 100%);
    z-index: 2;
}

.sf-modal__body {
    padding-top: 28px !important;
}

.sf-modal__close {
    border-radius: 10px !important;
}

.sf-modal__title {
    font-family: yekanB, sans-serif;
    font-size: 20px;
    line-height: 1.45;
    color: #1A202C;
    margin: 0 0 14px;
    padding-left: 44px;
}

.sf-modal__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #EDF2F7;
}

.sf-modal__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #EEF0F8 0%, #F8FAFC 100%);
    border: 1px solid rgba(67, 76, 131, 0.12);
    margin-bottom: 0 !important;
}

.sf-modal__price-current {
    font-family: yekanB, sans-serif;
    font-size: 22px;
    color: #434C83 !important;
}

.sf-modal__price-original {
    font-family: yekanR, sans-serif;
    font-size: 14px;
    color: #A0AEC0 !important;
}

.sf-modal__badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: yekanM, sans-serif;
    font-size: 12px;
    line-height: 1.3;
    border: 1px solid transparent;
}

.sf-modal__badge--success {
    background: #F0FFF4;
    color: #276749;
    border-color: #C6F6D5;
}

.sf-modal__badge--danger {
    background: #FFF5F5;
    color: #C53030;
    border-color: #FEB2B2;
}

.sf-modal__panel {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #F8FAFC;
    border: 1px solid #E8EDF3;
    text-align: right;
}

.sf-modal__panel-title {
    margin: 0 0 12px !important;
    font-family: yekanM, sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #434C83 !important;
}

.sf-modal__desc {
    margin-bottom: 16px;
    padding-top: 14px;
    border-top: 1px solid #EDF2F7;
    max-height: 140px;
    overflow-y: auto;
}

.sf-modal__desc-label {
    margin: 0 0 8px;
    font-family: yekanM, sans-serif;
    font-size: 13px;
    color: #718096;
}

.sf-modal__desc-body {
    margin: 0;
    font-family: yekanR, sans-serif;
    font-size: 14px;
    line-height: 1.75;
    color: #4A5568;
}

/* Quick view — info column refinement */
.sf-modal--quick-view .sf-modal__info {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 16px 18px 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid #E2E8F0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
}

.sf-modal--quick-view .sf-modal__title {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.6;
    color: #1A202C;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-modal--quick-view .sf-modal__meta {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom-color: #E2E8F0;
}

.sf-modal--quick-view .sf-modal__price {
    width: 100%;
    justify-content: space-between;
}

.sf-modal--quick-view .sf-modal__stock {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sf-modal--quick-view .sf-modal__panel {
    margin-bottom: 12px;
}

.sf-modal--quick-view .sf-modal__desc {
    margin-bottom: 10px;
    padding-top: 10px;
    max-height: 120px;
}

.sf-modal--quick-view .sf-modal__desc-body {
    font-size: 13px;
    line-height: 1.7;
}

.sf-modal--quick-view .sf-modal__actions {
    margin-top: 4px;
}

/* Quick view attributes (read-only) */
.sf-modal--quick-view .quick-view-attr-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sf-modal--quick-view .quick-view-attr-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sf-modal--quick-view .quick-view-attr-name {
    font-family: yekanM, sans-serif;
    font-size: 13px;
    color: #434C83;
}

.sf-modal--quick-view .quick-view-attr-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sf-modal--quick-view .quick-view-attr-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #E2E8F0;
    font-family: yekanR, sans-serif;
    font-size: 13px;
    color: #1A202C;
}

.sf-modal--quick-view .quick-view-attr-chip--muted {
    color: #94A3B8;
    background: #F1F5F9;
}

/* Cart edit — attribute chips */
.sf-modal__attr-groups {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sf-modal__attr-legend {
    display: block;
    margin: 0 0 10px;
    padding: 0;
    font-family: yekanM, sans-serif;
    font-size: 13px;
    color: #434C83;
}

.sf-modal__attr-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
}

.sf-modal__attr-chip {
    position: relative;
    display: block;
    cursor: pointer;
    user-select: none;
}

.sf-modal__attr-chip .product-attr-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.sf-modal__attr-chip-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 56px;
    padding: 8px;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    background: #fff;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.sf-modal__attr-chip-radio {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #CBD5E0;
    position: relative;
}

.sf-modal__attr-chip-radio::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: #434C83;
    transform: scale(0);
    transition: transform 0.15s ease;
}

.sf-modal__attr-chip-label {
    font-family: yekanR, sans-serif;
    font-size: 13px;
    line-height: 1.35;
    color: #1A202C;
}

.sf-modal__attr-chip .product-attr-input:checked + .sf-modal__attr-chip-box {
    border-color: #434C83;
    background: #EEF0F8;
    box-shadow: 0 0 0 3px rgba(67, 76, 131, 0.12);
}

.sf-modal__attr-chip .product-attr-input:checked + .sf-modal__attr-chip-box .sf-modal__attr-chip-radio {
    border-color: #434C83;
}

.sf-modal__attr-chip .product-attr-input:checked + .sf-modal__attr-chip-box .sf-modal__attr-chip-radio::after {
    transform: scale(1);
}

.sf-modal__attr-chip .product-attr-input:checked + .sf-modal__attr-chip-box .sf-modal__attr-chip-label {
    font-family: yekanM, sans-serif;
    color: #434C83;
}

/* Qty */
.sf-modal__panel--qty {
    text-align: right;
}

.sf-modal__qty-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
}

.sf-modal__qty-control {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.sf-modal__qty-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: #F8FAFC;
    color: #434C83;
    font-size: 20px;
    cursor: pointer;
}

.sf-modal__qty-btn:hover:not(:disabled) {
    background: #EEF0F8;
}

.sf-modal__qty-input {
    width: 56px;
    height: 42px;
    border: none;
    border-left: 1px solid #E2E8F0;
    border-right: 1px solid #E2E8F0;
    text-align: center;
    font-family: yekanR, sans-serif;
    font-size: 16px;
    -moz-appearance: textfield;
}

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

.sf-modal__qty-unit {
    font-family: yekanR, sans-serif;
    font-size: 13px;
    color: #718096;
}

.sf-modal__message {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #FFF5F5;
    border: 1px solid #FEB2B2;
    color: #C53030;
    font-family: yekanR, sans-serif;
    font-size: 13px;
    line-height: 1.55;
    text-align: right;
}

.sf-modal__actions {
    margin-top: auto;
    padding-top: 4px;
}

.sf-modal__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    font-family: yekanM, sans-serif;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.sf-modal__btn--primary {
    background: #434C83;
    color: #fff;
    box-shadow: 0 4px 14px rgba(67, 76, 131, 0.22);
}

.sf-modal__btn--primary:hover:not(:disabled) {
    background: #363D6B;
}

.sf-modal__btn--primary:disabled {
    background: #A0AEC0;
    box-shadow: none;
    cursor: not-allowed;
}

/* Gallery */
.sf-modal__gallery-main {
    background: #F8FAFC;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid #E8EDF3;
}

.sf-modal__gallery .single-img {
    border-radius: 10px;
    aspect-ratio: 1;
    object-fit: cover;
}

.sf-modal__gallery .thumbnail-images {
    width: 56px;
    height: 56px;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    opacity: 0.55;
    border: 2px solid transparent;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}

.sf-modal__gallery .thumbnail-images.active-thumbnail {
    opacity: 1;
    border-color: #434C83;
}

.sf-modal__gallery-controls {
    margin-top: 12px;
}

/* Cart table — edit column */
.cart-table {
    min-width: 640px;
}

.cart-col-edit-cell {
    min-width: 88px;
}

.cart-col-attrs-cell {
    gap: 10px;
    align-items: center;
}

.cart-attr-qty-line {
    width: 100%;
    justify-content: center;
    margin-bottom: 4px;
}

.cart-edit-item-btn {
    min-width: 84px;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

@media screen and (max-width: 768px) {
    .sf-modal__title {
        font-size: 18px;
    }

    .sf-modal__price-current {
        font-size: 20px;
    }

    .sf-modal__attr-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cart-col-edit {
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }
}

@media screen and (min-width: 769px) {
    .quick-view-dialog__body.sf-modal__body {
        gap: 24px;
        padding: 28px 26px 26px !important;
    }
}
