/* ============================================================
    ზოგადი სტილები
============================================================ */
:root {
    --brand-color: #e67e22;
    --success-color: #e67e22;
    --danger-color: #e74c3c;
    --light-gray: #f8f9fa;
    --border-color: #e0e0e0;
    --text-color: #495057;
    --text-dark: #212529;
}

body {
    background-color: var(--light-gray);
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
    color: var(--text-color);
    /* Add transition for smooth opacity/filter changes */
    transition: opacity 0.3s ease-out, filter 0.3s ease-out;
}

.page-header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.page-header h1 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin: 0;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}

.main-wrapper {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.page-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    margin-top: 30px;
    margin-bottom: 30px;
    /* Add transition for smooth opacity/filter changes */
    transition: opacity 0.3s ease-out, filter 0.3s ease-out;
}

@media (min-width: 992px) {
    .page-container {
        grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
        gap: 40px;
    }
}

.cart-items-column {
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 0 25px;
}

.cart-item {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 25px 0;
    display: grid;
    /* დესკტოპის სვეტები: სურათი | ინფო | რაოდენობა | ფასი და წაშლა (ერთად) */
    grid-template-columns: auto 1fr auto 150px;
    gap: 15px;
    align-items: center; /* ცენტრში გასწორება */
    transition: background-color 0.2s ease, opacity 0.4s ease, transform 0.4s ease, height 0.4s ease, padding 0.4s ease, margin 0.4s ease, border 0.4s ease; /* Added transitions for removal */
    border-radius: 0;
}
.cart-items-column .cart-item:last-child {
    border-bottom: none;
}
.cart-item:hover {
    box-shadow: none;
    background-color: #f8f9fa;
}
/* Style for item being removed */
.cart-item.removing {
    opacity: 0;
    transform: translateY(-10px);
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-width: 0;
    overflow: hidden; /* Prevent content spill during animation */
}
/* Style for item quantity being updated */
.cart-item.updating {
    opacity: 0.7;
    pointer-events: none; /* Prevent clicks during update */
}


.item-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.item-info .item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    line-clamp: 2;
    line-height: 1.4; /* ხაზის სიმაღლე */
    max-height: 2.8em; /* line-height * 2 */
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.item-info .item-name:hover {
    color: var(--brand-color);
}

.item-price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-top: 5px;
    min-height: 2.5em; /* მინიმალური სიმაღლე დესკტოპზეც */
}
.item-price {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.2;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.item-price.sale-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-color);
}
.item-price.old-price {
    font-size: 0.85rem;
    color: #95a5a6;
    text-decoration: line-through;
}

.item-price-and-remove {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.item-price-and-remove .item-total-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    text-align: left;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}

.item-price-and-remove .remove-btn {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    font-size: 1.1rem; /* Adjusted for SVG potentially */
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    transition: all 0.2s ease;
    justify-self: end;
    flex-shrink: 0;
    display: inline-flex; /* Ensure SVG aligns center */
    align-items: center;
    justify-content: center;
}
.item-price-and-remove .remove-btn:hover {
    color: var(--danger-color);
    background-color: #fff0f0;
}
.item-price-and-remove .remove-btn svg { /* Style for the SVG icon */
     pointer-events: none;
     width: 1em;
     height: 1em;
}


.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background-color: #fff;
    justify-self: center;
}
.quantity-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
    width: 35px;
    height: 35px;
    line-height: 35px;
    transition: background-color 0.2s;
    display: inline-flex; /* Align icon center */
    align-items: center;
    justify-content: center;
}
.quantity-btn:hover:not(:disabled) { /* Add :not(:disabled) */
    background-color: #f1f3f5;
}
.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.quantity-btn.minus { border-radius: 50px 0 0 50px; }
.quantity-btn.plus { border-radius: 0 50px 50px 0; }

.quantity-input {
    width: 40px;
    text-align: center;
    border: none;
    background: none;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-dark);
    -moz-appearance: textfield;
    appearance: textfield;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.summary-box-wrapper {
    position: sticky;
    top: 100px;
    align-self: flex-start;
}
.summary-box {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.summary-box h3 {
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: var(--text-dark);
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1rem;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.summary-item span:first-child { color: var(--text-color); }
.summary-item span:last-child { font-weight: 600; color: var(--text-dark); }

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}

.customer-details {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.customer-details h3 {
    margin-top: 0;
    padding-bottom: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.5rem;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.is-invalid {
    border-color: #dc3545 !important;
}

.choices { margin-bottom: 0; }
.choices__inner {
    background-color: #fff; border: 1px solid #ced4da; border-radius: 8px;
    padding: 9px 15px; font-size: 1rem; min-height: auto;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.is-focused .choices__inner, .is-open .choices__inner {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}
.choices__list--dropdown { border-radius: 8px; border: 1px solid var(--border-color); }
.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: var(--brand-color);
}
.choices[data-type*="select-one"]::after {
    border-color: #333 transparent transparent; right: 15px; margin-top: -3.5px;
}
.choices[data-type*="select-one"].is-open::after {
    border-color: transparent transparent #333; margin-top: -3.5px;
}

.choices.is-invalid .choices__inner {
    border-color: #dc3545 !important;
}

.choices + .invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

.delivery-type-group {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.delivery-type-group > label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}

.radio-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.radio-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    background-color: #fff;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-color);
    text-align: center;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}

.radio-label:hover {
    border-color: var(--brand-color);
    background-color: #fff5ed;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-label input[type="radio"]:checked + span, .radio-label input[type="radio"]:checked ~ * {
    color: #fff;
}

.radio-label:has(input[type="radio"]:checked) {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.radio-label span {
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

@media (max-width: 576px) {
    .radio-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .radio-label {
        padding: 14px 18px;
    }
}

.action-btn {
    display: inline-block; /* Changed to inline-block for potential width adjustments */
    width: 100%; /* Ensure full width */
    text-align: center;
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    margin-top: 25px;
    font-size: 1.1rem;
    transition: background-color 0.2s, transform 0.1s, opacity 0.2s;
    font-family: var(--font-primary);
    position: relative; /* Needed if we add loading spinners directly */
    vertical-align: middle; /* Align if used next to other elements */
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.action-btn:active {
    transform: scale(0.98);
}

.action-btn.checkout {
    background-color: var(--brand-color);
}
.action-btn.checkout:hover:not(:disabled) { /* Added :not(:disabled) */
    background-color: #ca6f1f;
}

.action-btn.place-order {
    background-color: var(--success-color);
}
.action-btn.place-order:hover:not(:disabled) { /* Added :not(:disabled) */
    background-color: #ca6f1f;
}

.action-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    opacity: 0.7; /* Indicate disabled state */
}
/* No hover effect for disabled */

.delivery-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--brand-color);
    padding: 15px;
    border-radius: 8px;
    margin-top: 25px;
}
.delivery-notice i {
    font-size: 1.2rem;
    color: var(--brand-color);
    margin-top: 3px;
    flex-shrink: 0; /* Prevent icon shrinking */
}
.delivery-notice p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-color);
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.delivery-notice a {
    font-weight: 700;
    text-decoration: underline;
    color: var(--text-dark);
}
.delivery-notice a:hover {
    color: var(--brand-color);
}

.offline-mode-alert {
    padding: 15px 20px;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}

/* ============================================================
    Responsive ადაპტაცია (მობილურის დიზაინი)
============================================================ */
@media (max-width: 767px) {
    .cart-item {
        grid-template-columns: auto 1fr 80px;
        grid-template-areas:
            "image info     price-remove"
            "image controls price-remove";
        gap: 5px 12px;
        align-items: stretch;
        padding: 20px 0;
    }

    .cart-items-column {
        padding: 0 15px;
    }

    .item-image {
        grid-area: image;
        align-self: center;
    }

    .item-image img {
        width: 70px;
        height: 70px;
    }

    .item-info {
        grid-area: info;
        align-self: stretch;
        justify-self: start;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .item-info .item-name {
        font-size: 0.95rem;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        max-height: 2.6em;
        margin-bottom: 3px;
    }

    .item-price-wrapper {
        margin-top: auto;
        gap: 4px;
        min-height: 2.2em; /* Ensure space for two lines */
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }
     .item-price { font-size: 0.85rem; line-height: 1.1; }
     .item-price.sale-price { font-size: 0.9rem; line-height: 1.1; }
     .item-price.old-price { font-size: 0.8rem; line-height: 1.1; }

    .quantity-selector {
        grid-area: controls;
        align-self: end;
        justify-self: start;
    }

    .item-price-and-remove {
        grid-area: price-remove;
        display: flex;
        flex-direction: column;
        justify-content: space-between; /* Button top, Price bottom */
        align-items: flex-end; /* Align right */
        gap: 5px;
    }

    .item-price-and-remove .remove-from-cart-form {
        order: 1; /* Button first */
    }

    .item-price-and-remove .item-total-price {
        font-size: 1.05rem;
        order: 2; /* Price second */
    }

    .item-price-and-remove .remove-btn {
        padding: 0;
        width: 30px;
        height: 30px;
    }
}


/* ============================================================
    ცარიელი კალათის სტილი (ბარათის დიზაინი)
============================================================ */
.status-page {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    width: 100%;
    grid-column: 1 / -1;
    margin: 0 auto;
    max-width: 700px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.status-page .icon {
    font-size: 3.5rem; /* Base size for icon container */
    color: var(--brand-color);
    background-color: #fff5ed;
    width: 100px;
    height: 100px;
    line-height: 100px;
    border-radius: 50%;
    margin: 0 auto 25px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.status-page .icon svg { /* Style for SVG icon inside */
    width: 0.8em; /* Adjust size relative to container */
    height: 0.8em;
}

.status-page h1 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-family: var(--font-primary);
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}

.status-page p {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 30px;
    line-height: 1.6;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}

.continue-shopping-btn {
    display: inline-block;
    text-align: center;
    color: #fff;
    padding: 14px 30px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
    background-color: var(--brand-color);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.2);
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}

.continue-shopping-btn:hover {
    background-color: #ca6f1f;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(230, 126, 34, 0.3);
}

.continue-shopping-btn:active {
    transform: scale(0.98);
}

/* ============================================================
    ✨✨✨ NEW: გვერდის გადასვლის Top Loader ანიმაცია ✨✨✨
============================================================ */

/* --- ჩატვირთვის ზოლი --- */
#page-transition-loader {
    position: fixed; /* ფიქსირებული ეკრანის ზედა ნაწილში */
    top: 0;
    left: 0;
    width: 100%;
    height: 3px; /* ზოლის სისქე */
    background-color: var(--brand-color); /* ბრენდის ფერი */
    z-index: 9999; /* ყველაფერზე მაღლა */
    transform: scaleX(0); /* თავიდან დამალული (სიგანე 0) */
    transform-origin: left; /* ტრანსფორმაცია მარცხნიდან იწყება */
    transition: transform 0.3s ease-out, opacity 0.5s 0.2s ease-out; /* ანიმაცია */
    opacity: 0; /* თავიდან დამალული */
    pointer-events: none; /* არ რეაგირებს კლიკზე */
}

/* --- როდესაც გვერდი იტვირთება (body-ს აქვს კლასი) --- */
body.page-loading #page-transition-loader {
    transform: scaleX(1); /* ზოლი ივსება (სიგანე 100%) */
    opacity: 1; /* გამოჩენა */
    transition: transform 1.5s cubic-bezier(0.1, 0.7, 0.3, 1), opacity 0.1s ease-in; /* უფრო ნელი, რეალისტური ანიმაცია */
}

/* --- კონტენტის დაბინდვა/გამჭვირვალობა --- */
body.page-loading .page-container { /* სამიზნე გახდა .page-container */
    opacity: 0.6; /* კონტენტი ოდნავ გამჭვირვალე */
    filter: blur(1px); /* ოდნავ ბუნდოვანი (სურვილისამებრ) */
    /* transition is inherited from .page-container */
    pointer-events: none; /* კონტენტზე კლიკი ითიშება */
    user-select: none; /* ტექსტის მონიშვნა ითიშება */
}