/* Cart Page Component Styles */

/* Base Component Styles */
.cart-page-component {
    font-family: inherit;
    line-height: 1.6;
}

/* ================================
   WooCommerce Enterprise Notices
================================ */

.woocommerce-notices-wrapper {}

.woocommerce-message {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px !important;
    color: #0f5132;
    font-size: 15px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

/* Left accent bar (Enterprise touch) */


/* Remove default WooCommerce styles */
.woocommerce-message a {
    color: #007f5f;
    font-weight: 600;
    text-decoration: underline;
}

.woocommerce-message a:hover {
    text-decoration: none;
}

/* RTL Support */
body.rtl .woocommerce-message {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    background: #fff;
    padding-block: 7px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #e5e7eb6b;
    margin-bottom: 10px;
}

body.rtl .woocommerce-message::before {
    left: auto;
    right: 0;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .woocommerce-message {
        font-size: 14px;
        padding: 14px 16px;
    }
}

/* Empty Cart State */
.empty-cart-container {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-cart-icon i {
    display: block;
    line-height: 1;
}

/* Cart Items Table */
.cart-items-container {
    overflow-x: auto;
}

.cart-items-header {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Cart Item Styles */
.cart-item {
    position: relative;
    transition: all 0.2s ease;
}

.cart-item:hover {
    background-color: var(--gersh-gray-50, #f9fafb);
}

.cart-item.removing {
    opacity: 0.5;
    pointer-events: none;
}

.product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid var(--gersh-gray-200, #e5e7eb);
}

.product-name a:hover {
    color: var(--gersh-primary, #dafc71);
    text-decoration: none;
}

/* Quantity Controls */
.quantity-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--gersh-gray-300, #d1d5db);
    border-radius: 0.5rem;
    background: var(--gersh-gray-50, #f9fafb);
    overflow: hidden;
}

.quantity-controls button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--gersh-gray-600, #6b7280);
}

.quantity-controls button:hover {
    background: var(--gersh-gray-200, #e5e7eb);
    color: var(--gersh-gray-900, #111827);
}

.quantity-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 500;
    color: var(--gersh-gray-900, #111827);
}

.quantity-input:focus {
    outline: none;
    box-shadow: none;
}

/* Remove Button */
.remove-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    color: var(--gersh-red-500, #ef4444);
}

.remove-item-btn:hover {
    background: var(--gersh-red-50, #fef2f2);
    color: var(--gersh-red-600, #dc2626);
    transform: scale(1.1);
}

/* Cart Totals */
.cart-totals-container {
    background: white;
    border: 1px solid var(--gersh-gray-200, #e5e7eb);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gersh-gray-100, #f3f4f6);
}

.totals-row:last-child {
    border-bottom: none;
    font-size: 1.125rem;
    font-weight: 700;
    padding: 1rem 0;
}

.cart-total-amount {
    color: #000;
    background: #000;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

/* Coupon Form */
.coupon-form {
    border-top: 1px solid var(--gersh-gray-100, #f3f4f6);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.coupon-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gersh-gray-300, #d1d5db);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.coupon-input:focus {
    outline: none;
    border-color: #00000040;
    box-shadow: 0 0 0 3px rgb(0 0 0 / 10%);
}

.apply-coupon-btn {
    padding: 0.5rem 1rem;
    background: var(--gersh-gray-600, #6b7280);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.apply-coupon-btn:hover {
    background: var(--gersh-gray-700, #374151);
}

/* Checkout Button */
.checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 1.5rem;
    background: #000;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(218, 252, 113, 0.2);
}

.checkout-btn:hover {
    background: #191c20;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgb(0 0 0 / 30%);
    text-decoration: none;
}

.checkout-btn i {
    margin-right: 0.5rem;
}

/* Security Badge */
.security-badge {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gersh-gray-100, #f3f4f6);
}

.security-badge .flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--gersh-gray-500, #6b7280);
}

/* Cart Actions */
.cart-actions {
    background: var(--gersh-gray-50, #f9fafb);
    border-top: 1px solid var(--gersh-gray-200, #e5e7eb);
}

.update-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    background: var(--gersh-gray-600, #6b7280);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.update-cart-btn:hover {
    background: var(--gersh-gray-700, #374151);
}

/* Loading States */
.cart-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.cart-loading-overlay.show {
    display: flex;
}

.cart-loading-overlay .bg-white {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Cart Count Badge */
.cart-count-badge {
    background: var(--gersh-primary, #dafc71);
    color: var(--gersh-primary-dark, #374151);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    width: fit-content;
}

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

    .cart-totals-container {
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-item .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cart-items-header {
        display: none;
    }

    .cart-item {
        padding: 1rem;
    }

    .cart-item .col-span-6,
    .cart-item .col-span-2 {
        grid-column: span 1;
    }

    .product-thumbnail img {
        width: 60px;
        height: 60px;
    }

    .quantity-controls {
        justify-self: start;
    }

    .cart-actions .flex {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .cart-page-component {
        padding-top: 135px;
        padding-bottom: 60px;
    }

    .cart-header .flex {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .cart-totals-content {
        padding: 1rem;
    }

    .checkout-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* RTL Support */
[dir="rtl"] .cart-item .flex {
    direction: rtl;
}

[dir="rtl"] .product-details {
    text-align: right;
}

[dir="rtl"] .quantity-controls button:first-child {
    order: 2;
}

[dir="rtl"] .quantity-controls button:last-child {
    order: 0;
}

[dir="rtl"] .checkout-btn i {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .security-badge .flex {
    direction: rtl;
}

/* Animation Utilities */
.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .cart-item:hover {
        background: #000;
        color: #fff;
    }

    .checkout-btn {
        border: 2px solid currentColor;
    }

    .quantity-controls {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .cart-item,
    .checkout-btn,
    .quantity-controls button,
    .remove-item-btn {
        transition: none;
    }

    .animate-spin {
        animation: none;
    }
}

.wc-proceed-to-checkout {
    padding-bottom: 0 !important;
}

a.checkout-button.button.alt.wc-forward {
    background: #000000;
    color: #fff;
    border-radius: 5px;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 0;
}

/* Quantity Input Styling */
.input-text.qty {
    width: 65px;
    height: 29px;
    padding: 6px 10px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    color: #1d546c;
    background-color: #ffffff;
    border: 1.5px solid #d0d5dd;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Remove arrows in Chrome, Edge, Safari */
.input-text.qty::-webkit-outer-spin-button,
.input-text.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove arrows in Firefox */
.input-text.qty {
    -moz-appearance: textfield;
}

/* Focus state */
.input-text.qty:focus {
    outline: none;
    border-color: #1d192a30;
    box-shadow: 0 0 0 3px rgb(29 25 42 / 12%);
}

/* Disabled state */
.input-text.qty:disabled {
    background-color: #f5f6f7;
    cursor: not-allowed;
    opacity: 0.7;
}

.woocommerce-cart-form__contents .actions .coupon {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
}

/* Style WooCommerce default cart table */
.woocommerce-cart-form__contents {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.woocommerce-cart-form__contents thead {
    display: none;
}

.woocommerce-cart-form__contents tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.woocommerce-cart-form__contents tbody tr:last-child {
    border-bottom: none;
}

.woocommerce-cart-form__contents tbody tr:hover {
    background-color: #f9fafb;
}

.woocommerce-cart-form__contents td {
    padding: 1.5rem;
    vertical-align: middle;
}

.woocommerce-cart-form__contents .product-thumbnail img {
    width: 80px;
    height: auto;
    border-radius: 0.5rem;
}

.woocommerce-cart-form__contents .product-name {
    font-weight: 600;
    color: #111827;
}

.woocommerce-cart-form__contents .product-name a {
    color: #111827;
    text-decoration: none;
}

.woocommerce-cart-form__contents .product-name a:hover {
    color: #374151;
}

.woocommerce-cart-form__contents .product-price,
.woocommerce-cart-form__contents .product-subtotal {
    font-weight: 600;
    color: #111827;
    text-align: center;
}

.woocommerce-cart-form__contents .product-quantity {
    text-align: center;
}

.woocommerce-cart-form__contents .product-remove {
    width: 50px;
}

.woocommerce-cart-form__contents .actions {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.woocommerce-cart-form__contents .actions .coupon {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.woocommerce-cart-form__contents .actions .coupon input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
}

.woocommerce-cart-form__contents .actions .coupon button {
    padding: 0.5rem 1rem;
    background-color: #4b5563;
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

.woocommerce-cart-form__contents .actions .coupon button:hover {
    background-color: #374151;
}

/* Responsive table */
@media (max-width: 768px) {
    .woocommerce-cart-form__contents thead {
        display: none;
    }

    .woocommerce-cart-form__contents tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        padding: 1rem;
    }

    .woocommerce-cart-form__contents tbody td {
        display: block;
        text-align: left !important;
        padding: 0.5rem 0;
    }

    .woocommerce-cart-form__contents tbody td:before {
        content: attr(data-title) ": ";
        font-weight: 600;
        display: inline-block;
        width: 100px;
    }

    .woocommerce-cart-form__contents .product-thumbnail {
        text-align: center;
    }

    .woocommerce-cart-form__contents .product-thumbnail:before {
        display: none;
    }
}

/* Updating state */
.woocommerce-cart-form__cart-item.updating {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.woocommerce-cart-form__cart-item.updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.woocommerce-cart-form__cart-item.updating::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f4f6;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    z-index: 11;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.coupon-input {
    width: 80%;

}

.woocommerce-cart table.cart .product-thumbnail {
    min-width: 80px;
}

.payment-method-preview span {
    display: flex;
    gap: 10px;
}