/**
 * Accore Cart Styles
 *
 * @package Accore
 */

/* ==========================================================================
   Cart Sidebar (Slide-in from right) - Figma node 3-707
   ========================================================================== */

/* Overlay */
.agui-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
}

.agui-cart-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Panel */
.agui-cart-sidebar {
    position: fixed;
    top: 0;
    right: -390px;
    width: 390px;
    height: 100vh;
    background-color: #13343b;
    box-shadow: -18px 0px 17.9px 0px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}

.agui-cart-sidebar.is-open {
    right: 0;
}

/* Prevent body scroll when cart is open */
body.agui-cart-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0px);
}

/* Prevent CLS (layout shift) on fixed/sticky header when scrollbar disappears */
body.agui-cart-open .site-header,
body.agui-cart-open header,
body.agui-cart-open .header-container {
    padding-right: var(--scrollbar-width, 0px);
    box-sizing: border-box;
}

/* Header */
.agui-cart-sidebar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 33px 24px 33px;
    flex-shrink: 0;
}

.agui-cart-sidebar__title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 36px;
    letter-spacing: 0.08px;
    color: #fff;
    margin: 0;
}

.agui-cart-sidebar__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s ease;
}

.agui-cart-sidebar__close:hover {
    opacity: 0.7;
}

.agui-cart-sidebar__close svg {
    width: 14px;
    height: 14px;
}

/* Items Container */
.agui-cart-sidebar__items {
    flex: 1;
    overflow-y: auto;
    padding: 0 33px;
    position: relative;
    transition: opacity 0.2s ease;
}

/* Loading state for cart items container */
.agui-cart-sidebar__items.is-loading {
    opacity: 0.4;
    pointer-events: none;
}

.agui-cart-sidebar__items.is-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: cartSpinner 0.7s linear infinite;
    z-index: 10;
}

@keyframes cartSpinner {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Cart Item - Simplified per Figma */
.agui-cart-sidebar__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transition: opacity 0.3s ease;
}

.agui-cart-sidebar__item.is-removing {
    opacity: 0.4;
    pointer-events: none;
}

.agui-cart-sidebar__item:last-child {
    border-bottom: none;
}

/* Remove X Button - Figma node 3:762 (14px) */
.agui-cart-sidebar__remove-x {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s ease;
    flex-shrink: 0;
    margin-top: 4px;
    position: relative;
}

.agui-cart-sidebar__remove-x:hover {
    color: #ff6b6b;
}

.agui-cart-sidebar__remove-x svg {
    width: 14px;
    height: 14px;
    transition: opacity 0.2s ease;
}

/* Loading state for remove button */
.agui-cart-sidebar__remove-x.is-loading svg {
    opacity: 0;
}

.agui-cart-sidebar__remove-x.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Product Thumbnail - Figma node 3:759 (83px, 7px radius) */
.agui-cart-sidebar__item-thumb {
    flex-shrink: 0;
    width: 83px;
    height: 83px;
    border-radius: 7px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.agui-cart-sidebar__item-thumb img,
.agui-cart-sidebar__item-thumb .agui-cart-sidebar__item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.agui-cart-sidebar__item-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Item Details - Simplified */
.agui-cart-sidebar__item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding-top: 4px;
}

/* Product Name - Figma node 3:764 (Roboto Regular 14px white) */
.agui-cart-sidebar__item-name {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.08px;
    color: #fff;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.agui-cart-sidebar__item-name:hover {
    text-decoration: underline;
}

/* Product Price - Figma node 3:765 (Roboto Bold 14px white) */
.agui-cart-sidebar__item-price {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.08px;
    color: #fff;
}

/* Item Meta Row (Price + Quantity) */
.agui-cart-sidebar__item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Quantity Display */
.agui-cart-sidebar__item-qty {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.08px;
    color: rgba(255, 255, 255, 0.6);
}

/* Legacy - Hide old controls if present */
.agui-cart-sidebar__item-header,
.agui-cart-sidebar__item-controls,
.agui-cart-sidebar__quantity,
.agui-cart-sidebar__qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    padding: 0;
    transition: color 0.2s ease;
}

.agui-cart-sidebar__qty-btn:hover {
    color: #fff;
}

.agui-cart-sidebar__qty-btn svg {
    width: 12px;
    height: 12px;
}

.agui-cart-sidebar__qty-value {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 20px;
    color: #fff;
    min-width: 20px;
    text-align: center;
}

/* Remove Button */
.agui-cart-sidebar__remove {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    line-height: 18px;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.agui-cart-sidebar__remove:hover {
    color: #ff6b6b;
}

/* Empty Cart State */
.agui-cart-sidebar__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 33px;
    text-align: center;
}

.agui-cart-sidebar__empty-icon {
    margin-bottom: 24px;
    opacity: 0.3;
}

.agui-cart-sidebar__empty-text {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 24px 0;
}

.agui-cart-sidebar__continue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 32px;
    letter-spacing: 0.16px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.agui-cart-sidebar__continue-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* Footer - Figma spec: divider line, subtotal, then buttons */
.agui-cart-sidebar__footer {
    flex-shrink: 0;
    padding: 0 33px 32px 33px;
}

/* Divider Line before Subtotal - Figma node 3:757 (324px width) */
.agui-cart-sidebar__footer::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
}

/* Totals Section - Simplified to just Subtotal */
.agui-cart-sidebar__totals {
    margin-bottom: 24px;
}

.agui-cart-sidebar__totals-title {
    display: none;
}

/* Subtotal Row - Figma nodes 3:756 (label), 3:758 (value) */
.agui-cart-sidebar__totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Subtotal Label - Figma: Inter Bold 14px white */
.agui-cart-sidebar__totals-label {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 36px;
    letter-spacing: 0.08px;
    color: #fff;
}

/* Subtotal Value - Figma: Inter Bold 14px rgba(255,255,255,0.48) */
.agui-cart-sidebar__totals-value {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 36px;
    letter-spacing: 0.08px;
    color: rgba(255, 255, 255, 0.48);
}

/* Hide unused elements */
.agui-cart-sidebar__totals-value--total,
.agui-cart-sidebar__shipping-note,
.agui-cart-sidebar__totals-divider,
.agui-cart-sidebar__totals-row--total,
.agui-cart-sidebar__totals-row--shipping {
    display: none;
}

/* Buttons - 324px width, 44px height, 8px radius - Figma nodes 3:749, 3:752 */
.agui-cart-sidebar__buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agui-cart-sidebar__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    width: 100%;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 32px;
    letter-spacing: 0.16px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* View Cart Button (First) - Figma node 3:752: transparent bg, white border 30% */
.agui-cart-sidebar__btn--outline {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.agui-cart-sidebar__btn--outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* Proceed to Checkout Button (Second) - Figma node 3:749: white bg, purple text */
.agui-cart-sidebar__btn--primary {
    background: #fff;
    color: #4e0b62;
    border: none;
}

.agui-cart-sidebar__btn--primary:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #4e0b62;
}

/* Arrow in Checkout button */
.agui-cart-sidebar__btn-arrow {
    font-size: 16px;
}

.agui-cart-sidebar__btn--primary svg {
    width: 16px;
    height: 16px;
}

/* Responsive */
@media (max-width: 480px) {
    .agui-cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .agui-cart-sidebar__header {
        padding: 24px 20px 16px 20px;
    }
    
    .agui-cart-sidebar__items {
        padding: 0 20px;
    }
    
    .agui-cart-sidebar__footer {
        padding: 20px;
    }
    
    .agui-cart-sidebar__title {
        font-size: 20px;
    }
}

/* ==========================================================================
   Cart Page Styles
   ========================================================================== */

/* Cart Page */
.woocommerce-cart .woocommerce {
    font-family: 'Inter', sans-serif;
}


.woocommerce-cart-form__contents {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-cart-form__contents th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: rgba(19, 52, 59, 0.7);
    background: #f8f8f6;
    border: none;
}

.woocommerce-cart-form__contents th:first-child {
    border-radius: 8px 0 0 8px;
}

.woocommerce-cart-form__contents th:last-child {
    border-radius: 0 8px 8px 0;
}

.woocommerce-cart-form__contents td {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: middle;
}

.woocommerce-cart-form__contents tr:last-child td {
    border-bottom: none;
}

/* Product Thumbnail */
.woocommerce-cart-form__contents .product-thumbnail {
    width: 80px;
}

.woocommerce-cart-form__contents .product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

/* Product Name */
.woocommerce-cart-form__contents .product-name {
    font-weight: 500;
    color: #13343b;
}

.woocommerce-cart-form__contents .product-name a {
    color: inherit;
    text-decoration: none;
}

.woocommerce-cart-form__contents .product-name a:hover {
    color: #4e0b62;
}

/* Product Price */
.woocommerce-cart-form__contents .product-price,
.woocommerce-cart-form__contents .product-subtotal {
    font-size: 15px;
    font-weight: 600;
    color: #13343b;
}

/* Quantity Input */
.woocommerce-cart-form__contents .quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.woocommerce-cart-form__contents .quantity input[type="number"] {
    width: 60px;
    height: 40px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: #fcfcf9;
}

.woocommerce-cart-form__contents .quantity input:focus {
    outline: none;
    border-color: #4e0b62;
    box-shadow: 0 0 0 3px rgba(78, 11, 98, 0.1);
}

/* Remove Item */
.woocommerce-cart-form__contents .product-remove a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #dc2626;
    border-radius: 50%;
    font-size: 18px;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Cart Actions */
.woocommerce-cart-form__contents .actions {
    padding: 20px 16px;
}

.woocommerce-cart-form__contents .actions .coupon {
    display: flex;
    gap: 12px;
}

.woocommerce-cart-form__contents .actions .coupon input[type="text"] {
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: #fcfcf9;
    min-width: 200px;
}

.woocommerce-cart-form__contents .actions .coupon input:focus {
    outline: none;
    border-color: #4e0b62;
    box-shadow: 0 0 0 3px rgba(78, 11, 98, 0.1);
}

.woocommerce-cart-form__contents .actions button {
    height: 44px;
    padding: 0 20px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.woocommerce-cart-form__contents .actions button[name="apply_coupon"] {
    background: rgba(78, 11, 98, 0.1);
    color: #4e0b62;
}

.woocommerce-cart-form__contents .actions button[name="apply_coupon"]:hover {
    background: rgba(78, 11, 98, 0.15);
}

.woocommerce-cart-form__contents .actions button[name="update_cart"] {
    background: #13343b;
    color: #fff;
    float: right;
}

.woocommerce-cart-form__contents .actions button[name="update_cart"]:hover {
    background: #0d2428;
}

.woocommerce-cart-form__contents .actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cart Totals */
.cart_totals {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.cart_totals h2 {
    font-size: 18px;
    font-weight: 600;
    color: #13343b;
    margin: 0 0 20px 0;
}

.cart_totals table {
    width: 100%;
    border-collapse: collapse;
}

.cart_totals table th,
.cart_totals table td {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.cart_totals table th {
    text-align: left;
    font-weight: 500;
    color: rgba(19, 52, 59, 0.7);
    font-size: 14px;
}

.cart_totals table td {
    text-align: right;
    font-size: 14px;
    color: #13343b;
}

.cart_totals table tr.order-total th,
.cart_totals table tr.order-total td {
    border-bottom: none;
    padding-top: 16px;
    font-size: 18px;
    font-weight: 600;
}

.cart_totals .wc-proceed-to-checkout {
    margin-top: 20px;
}

.cart_totals .wc-proceed-to-checkout .checkout-button {
    display: block;
    width: 100%;
    height: 52px;
    background: #4e0b62;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    line-height: 52px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cart_totals .wc-proceed-to-checkout .checkout-button:hover {
    background: #3a0849;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(78, 11, 98, 0.3);
}

/* Empty Cart */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
}

.cart-empty::before {
    content: '';
    display: block;
    width: 80px;
    height: 80px;
    background: rgba(78, 11, 98, 0.08);
    border-radius: 50%;
    margin: 0 auto 24px;
}

.return-to-shop {
    margin-top: 24px;
}

.return-to-shop .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    background: #4e0b62;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.agui-cart-sidebar__item-details {
    height: 100%;
}
span.agui-cart-sidebar__item-price {
    margin-bottom: 0;
    margin-top: auto;
}
button.agui-cart-sidebar__remove-x {
    margin: auto;
}
.agui-cart-sidebar__totals {
    padding: 0;
}
.agui-cart-sidebar__footer::before{
    display:none;

}
.agui-cart-sidebar__buttons {
    padding: 0;
}
.agui-cart-sidebar__totals {
    padding-top: 7px;
}
.return-to-shop .button:hover {
    background: #3a0849;
}

/* Cross-sells */
.cross-sells {
    margin-top: 40px;
}

.cross-sells h2 {
    font-size: 20px;
    font-weight: 600;
    color: #13343b;
    margin: 0 0 24px 0;
}

.cross-sells .products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Responsive */
@media (max-width: 991px) {
    .woocommerce-cart-form__contents .product-thumbnail {
        width: 60px;
    }
    
    .woocommerce-cart-form__contents .product-thumbnail img {
        width: 60px;
        height: 60px;
    }
    
    .cross-sells .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .woocommerce-cart-form,
    .cart_totals {
        padding: 16px;
    }
    
    .woocommerce-cart-form__contents,
    .woocommerce-cart-form__contents thead,
    .woocommerce-cart-form__contents tbody,
    .woocommerce-cart-form__contents th,
    .woocommerce-cart-form__contents td,
    .woocommerce-cart-form__contents tr {
        display: block;
    }
    
    .woocommerce-cart-form__contents thead {
        display: none;
    }
    
    .woocommerce-cart-form__contents tr {
        padding: 16px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }
    
    .woocommerce-cart-form__contents td {
        padding: 8px 0;
        border: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .woocommerce-cart-form__contents td::before {
        content: attr(data-title);
        font-weight: 500;
        color: rgba(19, 52, 59, 0.7);
    }
    
    .woocommerce-cart-form__contents .actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .woocommerce-cart-form__contents .actions .coupon {
        flex-direction: column;
        width: 100%;
    }
    
    .woocommerce-cart-form__contents .actions .coupon input[type="text"] {
        min-width: 100%;
    }
    
    .woocommerce-cart-form__contents .actions button[name="update_cart"] {
        float: none;
        width: 100%;
    }
}
