/* Cart Page Styles */
.cart-page {
    padding-top: 40px;
    padding-bottom: 60px;
}

.cart-page .page-title {
    color: #0b2367;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* Empty State */
.empty-cart-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.empty-cart-state h2 {
    margin-bottom: 10px;
    color: #333;
}

.empty-cart-state p {
    color: #666;
    margin-bottom: 30px;
}

.empty-cart-state .btn {
    display: inline-block;
    padding: 12px 30px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Cart Table */
.cart-items-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 20px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid #f3f4f6;
    color: #6b7280;
    font-weight: 600;
}

.cart-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.cart-table tr:last-child td {
    border-bottom: none;
}

.cart-product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.cart-product-name {
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}

.cart-note-wrapper {
    margin-top: 8px;
    position: relative;
    max-width: 300px;
}

.cart-note-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #555;
    transition: border-color 0.2s;
    padding-right: 50px;
    /* Space for counter */
    font-family: inherit;
    resize: none;
    /* Auto-resize via JS */
    overflow: hidden;
    min-height: 38px;
    line-height: 1.4;
}

.cart-note-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.char-count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    /* Move to bottom for multiline */
    top: auto;
    transform: none;
    font-size: 0.75rem;
    color: #999;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.8);
    /* Background to readability over text */
    padding: 2px 4px;
    border-radius: 4px;
}

/* Qty Control */
.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 100px;
}

.qty-control button {
    width: 30px;
    height: 34px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #666;
}

.qty-control input {
    width: 40px;
    height: 34px;
    text-align: center;
    border: none;
    font-weight: 600;
    /* remove arrows */
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.col-price,
.col-total {
    white-space: nowrap;
}

.col-total {
    font-weight: 700;
    color: var(--color-text);
}

.btn-remove {
    background: none;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-remove:hover {
    color: #ef4444;
}

/* Summary Sidebar */
.summary-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 100px;
}

.summary-card h3 {
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.summary-row span:last-child {
    white-space: nowrap;
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #f3f4f6;
}

.summary-note {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 20px;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    /* Increased spacing */
}

.btn-outline:hover {
    border-color: #999;
    background: #f5f5f5;
    color: #333;
    /* Darker text on hover */
}

/* Responsive Cart */
@media (max-width: 768px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tr {
        display: flex;
        flex-wrap: wrap;
        position: relative;
        border: 1px solid #eee;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
    }

    .cart-table td {
        border: none;
        padding: 5px 0;
    }

    .col-product {
        width: 100%;
        margin-bottom: 10px;
    }

    .col-price::before,
    .col-qty::before,
    .col-total::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        margin-right: 5px;
        color: #888;
    }

    .col-price,
    .col-qty,
    .col-total {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .col-remove {
        position: absolute;
        top: 10px;
        right: 10px;
    }
}