/* Modern Black E-commerce Cart */
:root {
    --primary-bg: #0c0c0c;
    --secondary-bg: #1a1a1a;
    --card-bg: #252525;
    --border-color: #333333;
    --text-primary: #f5f5f5;
    --text-secondary: #aaaaaa;
    --accent-color: #f5a623;
    --accent-hover: #f7b84c;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-primary);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.cart-wrapper {
    padding: 40px 0;
    min-height: 80vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Notification */
.notification {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    animation: slideDown 0.3s ease-out;
}

.notification-success {
    background-color: rgba(46, 204, 113, 0.1);
    border-left: 4px solid var(--success-color);
    color: var(--success-color);    
}

.notification i {
    margin-right: 12px;
    font-size: 18px;
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Cart Header */
.cart-header {
    margin-bottom: 30px;
    margin-left: 20px;
    text-align: center;
}

.cart-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.cart-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
}

/* Empty Cart */
.empty-cart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60vh;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.empty-cart-content {
    max-width: 500px;
}

.empty-cart-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-bg);
    border-radius: 50%;
}

.cart-svg {
    width: 60px;
    height: 60px;
    fill: var(--text-secondary);
}

.empty-cart-content h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.empty-cart-content p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 16px;
}

/* Cart Content Layout */
.cart-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* Cart Table */
.cart-items {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    overflow: hidden;
    /* Add border for product summary */
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.table-responsive {
    overflow: hidden;
}

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

.cart-table th,
.cart-table td {
    word-wrap: break-word;
    text-align: left;
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.cart-table th {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.cart-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.cart-table th:nth-child(1),
.cart-table td:nth-child(1) {
    width: 40%;
}

.cart-table th:nth-child(2),
.cart-table td:nth-child(2),
.cart-table th:nth-child(3),
.cart-table td:nth-child(3),
.cart-table th:nth-child(4),
.cart-table td:nth-child(4) {
    width: 15%;
}

.cart-table th:nth-child(5),
.cart-table td:nth-child(5) {
    width: 10%;
}

/* Product Image */
.product-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #333;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-image img:hover {
    transform: scale(1.05);
}

.product-image img.img-error {
    object-fit: contain;
    padding: 10px;
    background-color: #333;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.no-image-placeholder:after {
    content: 'No Image';
    font-size: 12px;
}

/* Product Info */
.product-name {
    font-weight: 500;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.product-sku {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Product Price */
.product-price {
    font-weight: 600;
    color: var(--text-primary);
}

/* Quantity Controller */
.quantity-controller {
    display: flex;
    align-items: center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    width: fit-content;
}

.qty-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.qty-btn:hover {
    color: var(--accent-color);
}

.qty-input {
    width: 40px;
    height: 36px;
    border: none;
    background: none;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    /* -moz-appearance: textfield; */
    font-size: 16px;
}

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

/* Product Total */
.product-total {
    font-weight: 600;
    color: var(--accent-color);
}

/* Trash Icon Button */
.remove-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(231, 76, 60, 0.1);
    border: none;
    color: var(--danger-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background-color: var(--danger-color);
    color: white;
}

/* Cart Sidebar */
.cart-sidebar {
    align-self: flex-start;
}

.cart-summary {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    padding: 24px;
    /* Add border for order summary */
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.summary-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.summary-label {
    color: var(--text-secondary);
}

.summary-value {
    font-weight: 500;
    color: var(--text-primary);
}

.summary-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}

.summary-item.total {
    margin-bottom: 25px;
}

.summary-item.total .summary-label,
.summary-item.total .summary-value {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
}

.summary-item.total .summary-value {
    color: #fad565 !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

/* --- Animated Button Style for btn-continue and btn-checkout --- */
.btn-continue,
.btn-checkout {
    position: relative;
    overflow: hidden;
    z-index: 1;
    background: #fad565 !important;
    color: #23201e !important;
    border: 1px solid #fad565;
    font-family: 'Jost', 'Inter', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 35px 13px !important;
    border-radius: 0 !important;
    transition: color 0.3s;
    cursor: pointer;
    display: inline-block;
    outline: none;
    text-decoration: none !important;
    width: 100%;
    box-sizing: border-box;
}

.btn-continue::before,
.btn-continue::after,
.btn-checkout::before,
.btn-checkout::after {
    content: '';
    position: absolute;
    top: 0;
    width: 58%;
    height: 100%;
    background: #23201e;
    z-index: 2;
    pointer-events: none;
    opacity: 1;
    transition: transform 0.5s cubic-bezier(.77,0,.18,1);
    transform: skewX(-18deg);
}

.btn-continue::before,
.btn-checkout::before {
    left: -8px;
    transform: translateX(-100%) skewX(-18deg);
}

.btn-continue::after,
.btn-checkout::after {
    right: -8px;
    transform: translateX(100%) skewX(-18deg);
}

.btn-continue:hover::before,
.btn-continue:focus::before,
.btn-checkout:hover::before,
.btn-checkout:focus::before {
    transform: translateX(0) skewX(-18deg);
}

.btn-continue:hover::after,
.btn-continue:focus::after,
.btn-checkout:hover::after,
.btn-checkout:focus::after {
    transform: translateX(0) skewX(-18deg);
}

.btn-continue span,
.btn-checkout span {
    position: relative;
    z-index: 3;
    color: #111;
    background: transparent !important;
}

.btn-continue:hover,
.btn-continue:focus,
.btn-checkout:hover,
.btn-checkout:focus {
    color: #23201e !important;
}

.btn-continue:hover span,
.btn-continue:focus span,
.btn-checkout:hover span,
.btn-checkout:focus span {
    color: #fff !important;
    z-index: 3;
}

.btn-accent {
    background-color: var(--accent-color);
    color: #000;
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #fad565;
    color: rgb(0, 0, 0);
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #ec971f;
}

h3 {
    margin-top: 30px;
    color: var(--text-primary);
}

.saved-for-later {
    margin-top: 30px;
    background-color: #fad565 !important;
    border-radius: 12px;
    padding: 20px;
    color: #23201e !important;
}

.saved-for-later h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #23201e !important;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    padding: 15px 20px;
    border-radius: 8px;
    background-color: var(--card-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    animation: toastIn 0.3s ease forwards;
    max-width: 350px;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast-icon {
    margin-right: 12px;
    font-size: 20px;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Responsive Design */
@media (max-width: 992px) {
    .cart-content {
        grid-template-columns: 1fr;
    }
    .cart-sidebar {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .cart-wrapper {
        padding: 20px 0;
    }
    .cart-title {
        font-size: 24px;
    }
    .cart-table th:nth-child(3),
    .cart-table td:nth-child(3) {
        display: none;
    }
}

@media (max-width: 576px) {
    .cart-table thead {
        display: none;
    }
    .cart-table tbody tr {
        display: grid;
        grid-template-columns: 80px 1fr;
        grid-template-areas:
            "image name"
            "image price"
            "quantity total"
            "remove remove";
        gap: 10px;
        padding: 15px;
        position: relative;
    }
    .cart-table td {
        padding: 0;
        border: none;
    }
    .product-image-cell {
        grid-area: image;
    }
    .product-name-cell {
        grid-area: name;
    }
    .product-price-cell {
        grid-area: price;
    }
    .product-quantity-cell {
        grid-area: quantity;
        justify-self: start;
    }
    .product-total-cell {
        grid-area: total;
        justify-self: end;
        display: flex;
        align-items: center;
    }
    .product-remove-cell {
        grid-area: remove;
        display: flex;
        justify-content: flex-end;
    }
    .product-total-cell:before {
        content: 'Total: ';
        color: var(--text-secondary);
        margin-right: 5px;
    }
    .cart-table tbody tr {
        border-bottom: 1px solid var(--border-color);
    }
    .cart-table tbody tr:last-child {
        border-bottom: none;
    }
}

.flash-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(46, 204, 113, 0.9);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.flash-message.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
}

/* Add this new style for variant info */
.variant-info {
    font-size: 12px;
    color: var(--accent-color);
    margin-top: 4px;
    font-weight: 500;
}

.btn svg {
    background: none !important;
    display: inline !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: all 0.3s ease;
}

/* Target the SVG paths specifically */
.btn svg path {
    transition: fill 0.3s ease;
}

/* Default state - black icons */
.btn-continue svg path,
.btn-checkout svg path {
    fill: #111 !important;
}

/* Hover state - white icons */
.btn-continue:hover svg path,
.btn-continue:focus svg path,
.btn-checkout:hover svg path,
.btn-checkout:focus svg path {
    fill: #fff !important;
}