/* css/cart.css */

:root {
    --text-main: #050505;
    --text-secondary: #757575;
    --text-light: #a0a0a0;
    --bg-page: #ffffff;
    --bg-sidebar: #ffffff; /* POINT 1: Total White */
    --border-color: #f0f0f0;
    --accent: #000000;
    --danger: #d32f2f;
    --font-main: 'Manrope', sans-serif;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }

/* --- Layout --- */
.cart-split-layout {
    display: flex;
    flex-wrap: wrap;
    min-height: calc(100vh - 80px);
}

.cart-content-area {
    flex: 1;
    padding: 80px 8vw;
    border-right: 1px solid var(--border-color); /* Тонка лінія замість фону */
    max-width: 65%;
}

.content-wrapper {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    position: relative; /* Для позиціонування */
}

/* Сайдбар */
.cart-sidebar-area {
    flex: 0 0 35%;
    padding: 80px 50px;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

/* --- Typography & Header --- */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 60px;
}

.page-title {
    font-size: 32px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

.cart-count-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Back Link (Знизу) --- */
.back-link {
    display: inline-block;
    margin-top: 60px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 3px;
}
.back-link:hover { border-bottom-color: #000; }

/* --- Empty State (POINT 6) --- */
.empty-cart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 50vh; /* По центру екрану */
    animation: fadeIn 0.8s ease;
}

.empty-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.btn-start-shopping {
    background: var(--accent);
    color: #fff;
    padding: 18px 40px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    border: 1px solid var(--accent);
}

.btn-start-shopping:hover {
    background: #fff;
    color: var(--accent);
}

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

/* --- Cart List --- */
.cart-list { display: flex; flex-direction: column; }

.cart-item {
    display: flex;
    gap: 30px;
    padding: 35px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}
.cart-item:first-child { border-top: 1px solid var(--border-color); }

.cart-item-image {
    width: 120px;
    height: 160px;
    object-fit: cover;
    background-color: #f9f9f9;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px 0;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.item-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.item-variant {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.item-price { font-size: 14px; font-weight: 500; }

/* --- Controls --- */
.item-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.qty-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.qty-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
.qty-btn:hover { color: var(--text-main); }

.qty-value { font-size: 13px; font-weight: 500; min-width: 20px; text-align: center; }

.btn-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
    transition: var(--transition);
}
.btn-remove:hover { color: var(--danger); border-bottom-color: var(--danger); }

/* --- Summary --- */
.summary-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 30px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 20px;
    color: var(--text-secondary);
}
.summary-line span:last-child { color: var(--text-main); }

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #000;
    font-size: 16px;
    font-weight: 500;
}

.btn-checkout {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: var(--accent);
    color: #fff;
    padding: 20px;
    margin-top: 40px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    border: 1px solid var(--accent);
    cursor: pointer;
    transition: var(--transition);
}
.btn-checkout:hover { background-color: #fff; color: var(--accent); letter-spacing: 0.25em; }

.service-links {
    margin-top: auto;
    padding-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0.6;
}
.service-item { display: flex; gap: 15px; align-items: center; }
.s-text strong { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.s-text p { font-size: 10px; color: var(--text-secondary); }

/* --- Modal Overlay (POINT 4) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6); /* Дуже світлий фон */
    backdrop-filter: blur(12px); /* Сильний блюр */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active { display: flex; opacity: 1; }

.modal-box {
    background: #fff;
    padding: 50px 40px;
    width: 400px;
    max-width: 90%; /* Mobile friendly */
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08); /* Дуже м'яка тінь */
    border: 1px solid #f5f5f5;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-box { transform: scale(1); }

.modal-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.modal-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 30px; }

.modal-actions { display: flex; gap: 15px; justify-content: center; }

.btn-modal {
    padding: 12px 35px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    font-weight: 600;
    min-width: 100px;
    transition: var(--transition);
}

.btn-modal-outline { background: transparent; border: 1px solid #e0e0e0; color: var(--text-main); }
.btn-modal-outline:hover { border-color: #000; }

.btn-modal-solid { background: #000; border: 1px solid #000; color: #fff; }
.btn-modal-solid:hover { background: #fff; color: #000; }

/* --- Mobile / Responsive --- */
@media (max-width: 1024px) {
    .cart-split-layout { flex-direction: column; }
    .cart-content-area, .cart-sidebar-area { max-width: 100%; flex: auto; padding: 40px 20px; }
    .cart-content-area { border-right: none; }
    .cart-sidebar-area { border-top: 1px solid var(--border-color); height: auto; position: static; }
    
    /* Mobile Modal */
    .modal-box { width: 85%; padding: 40px 20px; }
    .modal-actions { flex-direction: column-reverse; gap: 10px; }
    .btn-modal { width: 100%; padding: 15px; }
}

@media (max-width: 768px) {
    .cart-item { gap: 20px; }
    .cart-item-image { width: 90px; height: 120px; }
    .page-title { font-size: 24px; }
    .item-header { flex-direction: column; gap: 5px; }
    .item-price { margin-left: 0; margin-top: 5px; }
}