/* ================================================
   MODERN SIDE CART BAR
   ================================================ */

/* Overlay */
.side-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.side-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Side Cart Panel */
.side-cart {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.side-cart.active {
    right: 0;
}

/* Header */
.side-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: var(--sidecart-header-bg, var(--top-bar-bg));
    flex-shrink: 0;
}

.side-cart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--sidecart-header-text, #fff);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.side-cart-header .cart-item-count {
    background: var(--search-btn-color);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    margin-left: 8px;
    display: inline-block;
}

.side-cart-close {
    background: none;
    border: none;
    color: var(--sidecart-header-text, #fff);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    transition: transform 0.2s ease;
    line-height: 1;
}

.side-cart-close:hover {
    transform: rotate(90deg);
}

/* Cart Items Container */
.side-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.side-cart-items::-webkit-scrollbar {
    width: 4px;
}

.side-cart-items::-webkit-scrollbar-thumb {
    background: #ccc;
}

/* Empty Cart */
.side-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 24px;
    text-align: center;
    color: #999;
}

.side-cart-empty i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #ddd;
}

.side-cart-empty h4 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #555;
    font-weight: 600;
}

.side-cart-empty p {
    margin: 0 0 24px;
    font-size: 14px;
    color: #999;
}

.side-cart-empty .btn-continue {
    display: inline-block;
    padding: 12px 28px;
    background: var(--top-bar-bg);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.3s ease;
}

.side-cart-empty .btn-continue:hover {
    background: var(--btn-hover-color, #333);
    color: #fff;
}

/* Single Cart Item */
.side-cart-item {
    display: flex;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    transition: background 0.2s ease;
}

.side-cart-item:hover {
    background: #fafafa;
}

.side-cart-item-img {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f5f5f5;
}

.side-cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.side-cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.side-cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.side-cart-item-meta {
    font-size: 12px;
    color: #888;
    margin: 0 0 6px;
}

.side-cart-item-meta span {
    margin-right: 10px;
}

.side-cart-item-price {
    display: none;
}

.side-cart-item-unit {
    font-size: 13px;
    color: #666;
}

.side-cart-item-total {
    font-size: 14px;
    font-weight: 700;
    color: var(--top-bar-bg);
    margin-left: 10px;
}

.side-cart-item-price-inline {
    display: inline;
    margin-left: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--top-bar-bg);
}

.side-cart-item-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 12px;
    font-weight: 400;
    margin-left: 6px;
}

/* Quantity Controls */
.side-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 6px;
}

.side-cart-item-qty .qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    color: #333;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
    user-select: none;
}

.side-cart-item-qty .qty-btn:hover {
    background: var(--top-bar-bg);
    color: #fff;
    border-color: var(--top-bar-bg);
    text-decoration: none;
}

.side-cart-item-qty .qty-minus {
    border-radius: 4px 0 0 4px;
}

.side-cart-item-qty .qty-plus {
    border-radius: 0 4px 4px 0;
}

.side-cart-item-qty .qty-value {
    width: 38px;
    height: 30px;
    text-align: center;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    border-left: none;
    border-right: none;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-cart-item-remove {
    position: absolute;
    top: 12px;
    right: 20px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
    line-height: 1;
}

.side-cart-item-remove:hover {
    color: var(--discount-color);
}

/* Footer Wrapper */
.side-cart-footer-wrapper {
    flex-shrink: 0;
    max-height: 50vh;
    overflow-y: auto;
}

/* Footer */
.side-cart-footer {
    border-top: 2px solid var(--top-bar-bg);
    padding: 20px 24px;
    background: #fafafa;
}

.side-cart-subtotal {
    display: none;
}

.side-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-cart-actions .btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    background: var(--sidecart-checkout-bg, var(--search-btn-color));
    color: var(--sidecart-checkout-text, #fff);
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
    gap: 0;
}

.side-cart-actions .btn-checkout .checkout-label {
    flex: 1;
    text-align: left;
}

.side-cart-actions .btn-checkout .checkout-total {
    font-size: 16px;
    font-weight: 700;
    margin-left: 12px;
    white-space: nowrap;
}

.side-cart-actions .btn-checkout:hover {
    background: var(--btn-hover-color, #333);
    color: var(--sidecart-checkout-text, #fff);
}

.side-cart-actions .btn-view-cart {
    display: none;
}

/* Free Shipping Bar */
.side-cart-shipping-bar {
    padding: 10px 24px;
    background: #f0fdf4;
    border-bottom: 1px solid #e0f2e9;
    text-align: center;
    font-size: 13px;
    color: #15803d;
    font-weight: 500;
    flex-shrink: 0;
}

.side-cart-shipping-bar i {
    margin-right: 6px;
}

/* ================================================
   MOBILE RESPONSIVE
   ================================================ */
@media (max-width: 480px) {
    .side-cart {
        width: 100vw;
        right: -100vw;
    }

    .side-cart-header {
        padding: 16px 16px;
    }

    .side-cart-item {
        padding: 14px 16px;
        gap: 12px;
    }

    .side-cart-item-img {
        width: 68px;
        height: 68px;
    }

    .side-cart-footer {
        padding: 16px;
    }

    .side-cart-item-name {
        font-size: 13px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .side-cart {
        width: 380px;
        right: -380px;
    }
}

/* Animation for items */
.side-cart-item {
    animation: slideInItem 0.3s ease forwards;
}

@keyframes slideInItem {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse animation for cart icon badge */
.cart-badge-pulse {
    animation: badgePulse 0.4s ease;
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Header cart trigger styling */
.cart-trigger {
    cursor: pointer;
    position: relative;
}

.cart-trigger .cart-count-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--accent-color, var(--search-btn-color));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    display: inline-block;
}

/* Favori simgesi rozeti — masaüstü sepet rozeti ile aynı ölçü/konum */
.favorite-trigger {
    cursor: pointer;
    position: relative;
}

.favorite-trigger .cart-count-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--accent-color, var(--search-btn-color));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    display: inline-block;
}

/* ================================================
   SIDE CART ADDRESS SECTIONS
   ================================================ */
.side-cart-addresses {
    margin-bottom: 14px;
}

.sc-address-section {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    background: #fff;
}

.sc-address-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f5f5f5;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
    gap: 8px;
}

.sc-address-header:hover {
    background: #eee;
}

.sc-addr-header-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sc-addr-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.sc-addr-title i {
    margin-right: 6px;
    color: var(--search-btn-color);
}

.sc-addr-preview {
    font-size: 11px;
    font-weight: 400;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.sc-addr-preview-empty {
    color: #e67e22;
    font-style: italic;
}

.sc-addr-preview-empty i {
    font-size: 10px;
    margin-right: 3px;
}

.sc-addr-arrow {
    font-size: 11px;
    transition: transform 0.2s ease;
    color: #999;
    flex-shrink: 0;
}

.sc-addr-arrow.open {
    transform: rotate(180deg);
}

.sc-address-body {
    display: none;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.5;
    border-top: 1px solid #eee;
    background: #fff;
}

.sc-address-body.open {
    display: block;
}

/* Address Form Styles */
.sc-addr-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sc-addr-form-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sc-addr-form-row label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sc-addr-form-row input,
.sc-addr-form-row select {
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    background: #fafafa;
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.sc-addr-form-row input:focus,
.sc-addr-form-row select:focus {
    border-color: var(--search-btn-color);
    outline: none;
    background: #fff;
}

.sc-addr-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sc-addr-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.sc-addr-save-btn {
    padding: 8px 18px;
    background: var(--top-bar-bg);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sc-addr-save-btn:hover {
    background: var(--search-btn-color);
}

.sc-addr-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sc-addr-save-msg {
    font-size: 12px;
    font-weight: 500;
}

.sc-addr-copy-row {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
}

.sc-addr-copy-label {
    font-size: 12px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sc-addr-copy-label input[type="checkbox"] {
    accent-color: var(--search-btn-color);
}

.sc-login-prompt {
    padding: 10px 0;
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-bottom: 10px;
}

.sc-login-prompt i {
    color: var(--search-btn-color);
    margin-right: 4px;
}

.sc-login-prompt a {
    color: var(--search-btn-color);
    font-weight: 600;
    text-decoration: underline;
}

/* ================================================
   PAYMENT DIALOG
   ================================================ */
.sc-payment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(3px);
}

.sc-payment-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sc-payment-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 528px;
    max-width: 95vw;
    max-height: 85vh;
    background: #fff;
    border-radius: 12px;
    z-index: 100001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.sc-payment-dialog.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.sc-payment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: var(--top-bar-bg);
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.sc-payment-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.sc-payment-header h3 i {
    margin-right: 8px;
    color: var(--search-btn-color);
}

.sc-payment-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.sc-payment-close:hover {
    transform: rotate(90deg);
}

.sc-payment-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.sc-payment-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 16px;
}

.sc-payment-total span:first-child {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.sc-payment-total-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.sc-payment-amount {
    font-size: 20px;
    font-weight: 700;
    color: #15803d;
}

.sc-payment-methods {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.sc-payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.sc-payment-option:hover {
    border-color: var(--search-btn-color);
    background: #fff8f4;
}

.sc-payment-option.is-selected {
    border-color: var(--search-btn-color);
    background: #fff8f4;
    box-shadow: inset 0 0 0 1px rgba(229, 90, 37, 0.08);
}

.sc-payment-option input[type="radio"] {
    accent-color: var(--search-btn-color);
    margin: 0;
}

.sc-payment-option-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.sc-payment-option-label i {
    margin-right: 6px;
    color: var(--search-btn-color);
    width: 18px;
    text-align: center;
}

.sc-payment-form {
    padding: 16px 0 0;
    animation: scFadeIn 0.2s ease;
}

@keyframes scFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sc-pay-field {
    margin-bottom: 10px;
}

.sc-pay-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.sc-pay-field input,
.sc-pay-field select,
.sc-pay-field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fafafa;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.sc-pay-field input:focus,
.sc-pay-field select:focus,
.sc-pay-field textarea:focus {
    border-color: var(--search-btn-color);
    outline: none;
    background: #fff;
}

.sc-pay-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.sc-pay-submit-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--search-btn-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.3s ease;
    margin-top: 12px;
}

.sc-pay-submit-btn:hover {
    background: #e55a25;
}

.sc-pay-submit-btn.is-ready,
.sc-pay-submit-btn:focus,
.sc-pay-submit-btn:active {
    background: #e55a25;
}

.sc-pay-submit-btn i {
    margin-right: 6px;
}

/* Paratika installment radios (side cart payment) */
.hm-paratika-install-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 4px;
}
.hm-paratika-install-opt {
    display: inline-grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-items: start;
    gap: 2px;
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    margin: 0;
    width: 100%;
    justify-content: flex-start;
    box-sizing: border-box;
}
.hm-paratika-install-opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    margin: 0;
}
.hm-paratika-install-opt-text {
    grid-column: 1;
    grid-row: 1;
    white-space: normal;
    line-height: 1.15;
    font-size: 11px;
}
.hm-paratika-install-opt-sub {
    grid-column: 1;
    grid-row: 2;
    font-size: 10px;
    color: #6b7280;
    line-height: 1.1;
}
.hm-paratika-install-opt[data-selected="1"] {
    border-color: var(--search-btn-color);
    background: #fff8f4;
    box-shadow: inset 0 0 0 1px rgba(229, 90, 37, 0.12);
}

@media (max-width: 480px) {
    .sc-payment-total-label {
        font-size: 11px;
        font-weight: 500;
        line-height: 1.2;
    }
    .sc-payment-dialog {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: translateY(100%);
    }
    .sc-payment-dialog.active {
        transform: translateY(0);
    }
    .sc-payment-header {
        border-radius: 0;
    }
    .sc-pay-field-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }
    .sc-pay-field-grid .sc-pay-field label {
        font-size: 10px;
        margin-bottom: 3px;
    }
    .sc-pay-field-grid .sc-pay-field select,
    .sc-pay-field-grid .sc-pay-field input {
        padding: 8px 6px;
        font-size: 12px;
    }
    .hm-paratika-install-options {
        gap: 5px;
    }
    .hm-paratika-install-opt {
        padding: 4px 6px;
        font-size: 10px;
        border-radius: 6px;
    }
    .hm-paratika-install-opt-text {
        white-space: normal;
        line-height: 1.1;
        font-size: 10px;
    }
    .hm-paratika-install-opt-sub {
        font-size: 9px;
    }
}
