/* =============================================================
   iStore Checkout — Frontend Styles
   ============================================================= */

/* ── Cart Page Widget ───────────────────────────────────────── */

.istore-cart-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #1d1d1f;
}

.istore-cart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
}

.istore-cart__title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.istore-cart__divider {
    height: 1px;
    background-color: #e0e0e0;
    margin-bottom: 0;
}

/* ── Empty State ─────────────────────────────────────────────── */

.istore-cart__empty {
    padding: 40px 0;
}

.istore-cart__empty-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #1d1d1f;
}

.istore-cart__empty-subtitle {
    font-size: 17px;
    color: #6e6e73;
    margin: 0;
}

/* ── Cart Items ──────────────────────────────────────────────── */

.istore-cart__items {
    margin-bottom: 0;
}

.istore-cart__item {
    display: flex;
    gap: 28px;
    padding: 32px 0;
    border-bottom: 1px solid #e0e0e0;
}

.istore-cart__item-image-wrap {
    flex-shrink: 0;
    align-self: flex-start;
}

.istore-cart__item-image {
    width: 140px;
    height: auto;
    object-fit: contain;
    display: block;
}

.istore-cart__item-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* ── Row 1: name + qty left, price + monthly + remove right ── */

.istore-cart__item-row1 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.istore-cart__item-name-qty {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.istore-cart__item-name {
    font-size: 19px;
    font-weight: 600;
    margin: 0;
    color: #1d1d1f;
    line-height: 1.3;
}

.istore-cart__item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.istore-cart__item-price {
    font-size: 19px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.istore-cart__item-monthly {
    font-size: 14px;
    color: #6e6e73;
    margin: 0;
}

/* ── Finance line ────────────────────────────────────────────── */

.istore-cart__item-finance {
    font-size: 14px;
    color: #6e6e73;
    margin: 0;
}

/* ── Qty Select ──────────────────────────────────────────────── */

.istore-cart__qty-wrap {
    position: relative;
    flex-shrink: 0;
}

.istore-cart__qty-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #f5f5f7;
    border: none;
    border-radius: 6px;
    padding: 5px 26px 5px 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231d1d1f' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    min-width: 56px;
}

.istore-cart__qty-select:focus {
    outline: 2px solid #0071e3;
    outline-offset: 2px;
}

/* ── Item Actions ────────────────────────────────────────────── */

.istore-cart__remove {
    font-size: 14px;
    color: #0071e3;
    text-decoration: none;
    margin-top: 4px;
}

.istore-cart__remove:hover {
    text-decoration: underline;
}

/* ── AppleCare+ Upsell ───────────────────────────────────────── */

.istore-cart__applecare {
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 18px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.istore-cart__applecare-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.istore-cart__applecare-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.istore-cart__applecare-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    line-height: 1.4;
}

.istore-cart__applecare-add {
    flex-shrink: 0;
    font-size: 15px;
    font-weight: 400;
    color: #0071e3;
    text-decoration: none;
}

.istore-cart__applecare-add:hover {
    text-decoration: underline;
}

.istore-cart__applecare-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.istore-cart__applecare-bullets {
    margin: 0 0 0 28px;
    padding: 0;
    list-style: disc;
}

.istore-cart__applecare-bullets li {
    font-size: 14px;
    color: #1d1d1f;
    margin-bottom: 4px;
    line-height: 1.5;
}

.istore-cart__applecare-footnote {
    font-size: 13px;
    color: #6e6e73;
    margin: 0;
}

.istore-cart__applecare-learn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #0071e3;
    text-decoration: none;
}

.istore-cart__applecare-learn:hover {
    text-decoration: underline;
}

/* ── Delivery ────────────────────────────────────────────────── */

.istore-cart__item-delivery {
    display: flex;
    gap: 0;
    border-top: 1px solid #e0e0e0;
    padding-top: 18px;
}

.istore-cart__applecare + .istore-cart__item-delivery {
    border-top: none;
}

.istore-cart__delivery-col {
    flex: 1;
}

.istore-cart__delivery-col + .istore-cart__delivery-col {
    border-left: 1px solid #e0e0e0;
    padding-left: 24px;
}

.istore-cart__delivery-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #1d1d1f;
    line-height: 1.5;
}

.istore-cart__delivery-svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
    color: #1d1d1f;
}

.istore-cart__delivery-date {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 2px 0 0;
}

.istore-cart__delivery-link {
    color: #0071e3;
    text-decoration: none;
}

.istore-cart__delivery-link:hover {
    text-decoration: underline;
}

/* ── Totals ──────────────────────────────────────────────────── */

.istore-cart__totals {
    padding: 28px 0 0;
}

.istore-cart__totals-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    font-size: 15px;
    color: #1d1d1f;
}

.istore-cart__totals-row:last-child {
    margin-bottom: 0;
}

.istore-cart__totals-divider {
    height: 1px;
    background-color: #d2d2d7;
    margin: 16px 0;
}

.istore-cart__totals-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.istore-cart__totals-row--total {
    font-size: 21px;
    font-weight: 700;
    align-items: flex-start;
}

.istore-cart__totals-vat {
    font-size: 13px;
    color: #6e6e73;
    font-weight: 400;
}

/* ── Pay Over Time ───────────────────────────────────────────── */

.istore-cart__pot {
    background-color: #f5f5f7;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.istore-cart__pot-main {
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: stretch;
}

.istore-cart__pot-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 20px;
}

.istore-cart__pot-right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    min-width: 180px;
    padding-left: 20px;
    border-left: 1px solid #d2d2d7;
}

.istore-cart__pot-klarna {
    display: inline-block;
    background-color: #FFB3C7;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 10px;
    line-height: 1.3;
    text-align: center;
}

.istore-cart__pot-cta {
    display: block;
    background-color: #1d1d1f;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 980px;
    line-height: 1.2;
    transition: background-color 0.15s ease;
}

.istore-cart__pot-cta:hover {
    background-color: #3a3a3a;
    color: #ffffff;
}

.istore-cart__pot-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.istore-cart__pot-headline {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    line-height: 1.1;
}

.istore-cart__pot-per-mo {
    font-size: 16px;
    font-weight: 400;
    color: #6e6e73;
}

.istore-cart__pot-terms {
    font-size: 13px;
    color: #6e6e73;
    margin: 0;
    line-height: 1.4;
}

.istore-cart__pot-body {
    font-size: 13px;
    color: #1d1d1f;
    margin: 0;
    line-height: 1.5;
}

.istore-cart__pot-footer {
    border-top: 1px solid #d2d2d7;
    margin-top: 16px;
    padding-top: 12px;
}

.istore-cart__pot-financed {
    font-size: 12px;
    color: #6e6e73;
}

.istore-cart__pot-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 13px;
    color: #0071e3;
    text-decoration: none;
}

.istore-cart__pot-link:hover {
    text-decoration: underline;
}

/* ── Cart Badge (injected onto custom targets) ───────────────── */

.istore-badge {
    position: absolute;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.istore-badge--hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

/* ── Standalone Widgets ──────────────────────────────────────── */

.istore-data-widget {
    margin: 0;
    line-height: 1.3;
}

.istore-data-widget__before,
.istore-data-widget__after {
    opacity: 1;
}

.istore-finance-widget--hidden {
    display: none !important;
}

.istore-btn-widget {
    display: inline-block;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

/* Alignment via prefix_class — mirrors Elementor's own Button widget */
.istore-btn-align-stretch .istore-btn-widget,
.istore-btn-align-stretch .istore-btn-widget { display: block; width: 100%; }

.istore-btn-align-left   { text-align: left; }
.istore-btn-align-center { text-align: center; }
.istore-btn-align-right  { text-align: right; }

/* Responsive tablet variants */
.istore-btn-tablet-align-stretch .istore-btn-widget { display: block; width: 100%; }
.istore-btn-tablet-align-left    { text-align: left; }
.istore-btn-tablet-align-center  { text-align: center; }
.istore-btn-tablet-align-right   { text-align: right; }

/* Responsive mobile variants */
.istore-btn-mobile-align-stretch .istore-btn-widget { display: block; width: 100%; }
.istore-btn-mobile-align-left    { text-align: left; }
.istore-btn-mobile-align-center  { text-align: center; }
.istore-btn-mobile-align-right   { text-align: right; }

.istore-btn-widget--hidden {
    display: none !important;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.istore-cart__btn-review {
    display: inline-block;
    background-color: #0071e3;
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 22px;
    border-radius: 980px;
    transition: background-color 0.2s ease;
}

.istore-cart__btn-review:hover {
    background-color: #0077ed;
    color: #ffffff;
    text-decoration: none;
}

.istore-cart__buttons {
    margin-top: 24px;
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.istore-cart__btn-checkout {
    display: block;
    flex: 1;
    text-align: center;
    text-decoration: none;
    font-size: 17px;
    font-weight: 500;
    padding: 18px 24px;
    border-radius: 980px;
    background-color: #0071e3;
    color: #ffffff;
    transition: opacity 0.2s ease;
}

.istore-cart__btn-checkout:hover {
    opacity: 0.85;
    text-decoration: none;
    color: #ffffff;
}

.istore-cart__btn-continue,
.istore-cart__btn-start {
    display: block;
    flex: 1;
    text-align: center;
    text-decoration: none;
    font-size: 17px;
    font-weight: 500;
    padding: 18px 24px;
    border-radius: 980px;
    background-color: #f5f5f7;
    color: #1d1d1f;
    transition: opacity 0.2s ease;
}

.istore-cart__btn-continue:hover,
.istore-cart__btn-start:hover {
    opacity: 0.8;
    text-decoration: none;
    color: #1d1d1f;
}

.istore-cart__empty .istore-cart__btn-start {
    margin-top: 24px;
}

/* ── Cart state visibility ───────────────────────────────────── */

body:not(.istore-cart-has-items) .istore-cart-filled-only {
    display: none !important;
}

/* =============================================================
   Mini Cart Widget
   ============================================================= */

.istore-mini-cart {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Content Panel ───────────────────────────────────────────── */

.istore-mini-cart__dropdown {
    width: 420px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    overflow: hidden;
}

.istore-mini-cart__dropdown.is-open {
    pointer-events: auto;
}

.istore-mini-cart__dropdown--bare {
    width: 100% !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.istore-mini-cart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.istore-mini-cart__title {
    font-size: 17px;
    font-weight: 700;
    color: #1d1d1f;
}

.istore-mini-cart__review-btn {
    display: inline-block;
    background-color: #0071e3;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 16px;
    border-radius: 980px;
    transition: background-color 0.2s ease;
}

.istore-mini-cart__review-btn:hover {
    background-color: #0077ed;
    color: #ffffff;
    text-decoration: none;
}

/* ── Content Body ────────────────────────────────────────────── */

.istore-mini-cart__body {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}

.istore-mini-cart__body::-webkit-scrollbar {
    width: 4px;
}

.istore-mini-cart__body::-webkit-scrollbar-track {
    background: transparent;
}

.istore-mini-cart__body::-webkit-scrollbar-thumb {
    background-color: #d2d2d7;
    border-radius: 2px;
}

/* ── Empty State ─────────────────────────────────────────────── */

.istore-mini-cart__empty {
    padding: 28px 20px;
}

.istore-mini-cart__empty-title {
    font-size: 17px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 8px;
}

.istore-mini-cart__empty-subtitle {
    font-size: 14px;
    color: #6e6e73;
    margin: 0;
}

/* ── Mini Cart Item ──────────────────────────────────────────── */

.istore-mini-cart__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.istore-mini-cart__item:last-child {
    border-bottom: none;
}

.istore-mini-cart__item-image {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
}

.istore-mini-cart__item-name {
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    line-height: 1.4;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
    .istore-cart__item {
        flex-wrap: wrap;
    }

    .istore-cart__item-name-qty {
        flex-wrap: wrap;
    }

    .istore-cart__item-right {
        align-items: flex-start;
    }

    .istore-cart__item-delivery {
        flex-direction: column;
        gap: 16px;
    }

    .istore-cart__delivery-col + .istore-cart__delivery-col {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #e0e0e0;
        padding-top: 16px;
    }

    .istore-cart__buttons {
        flex-direction: column;
    }

    .istore-mini-cart__dropdown {
        width: calc(100vw - 32px);
    }
}
