/**
 * Cart Page Styles - Optimized & Mobile-First
 * Performance-ready, responsive design
 */

/* ==========================================
   SKELETON LOADER (shown during AJAX updates for quantity changes)
   ========================================== */

.cart-skeleton-loader {
    display: none;
    width: 100%;
    gap: 20px;
}

.cart-skeleton-loader.active {
    display: grid;
}

.cart-skeleton-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.cart-skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.skeleton-badge {
    width: 60px;
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-remove {
    width: 24px;
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 50%;
}

.cart-skeleton-content {
    display: grid;
    gap: 15px;
}

.skeleton-thumbnail {
    width: 80px;
    height: 80px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-brand,
.skeleton-title,
.skeleton-attributes,
.skeleton-sku {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-brand {
    width: 80px;
}

.skeleton-title {
    width: 60%;
}

.skeleton-attributes {
    width: 50%;
}

.skeleton-sku {
    width: 120px;
}

.skeleton-price,
.skeleton-quantity,
.skeleton-subtotal {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-price {
    width: 80px;
}

.skeleton-quantity {
    width: 60px;
}

.skeleton-subtotal {
    width: 100px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ==========================================
   CART CONTAINER
   ========================================== */

.custom-cart-container {
    width: 100%;
    display: grid;
    gap: 20px;
    transition: opacity 0.3s ease;
}

.custom-cart-container.loading {
    opacity: 0.5;
    pointer-events: none;
}

#custom_shipping_block {
    display: none;
}

.bde-cart .woocommerce {
    display: grid !important;
    flex-direction: var(--bde-woo-responsive__stack);
    align-items: flex-start;
    flex-wrap: wrap;
    column-gap: var(--bde-woo-base-extra-large-gaps);
}
/* ==========================================
   CART ITEM CONTAINER (Mobile-First)
   ========================================== */

.cart-item-container {
    position: relative;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.3s ease;
}

/* Header: Badges + Remove */
.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cart-item-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.cart-item-remove a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.cart-item-remove a:hover {
    background-color: #f5f5f5;
}

.cart-item-remove img {
    width: 18px;
    height: 18px;
}

/* Main Content Layout (Mobile) */
.cart-item-content {
    display: grid;
    gap: 15px;
}

/* Thumbnail */
.cart-item-thumbnail {
    width: 100%;
    max-width: 120px;
    margin: 0 auto;
}

.cart-item-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Product Details */
.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-brand {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-category {
    font-size: 12px;
    color: #666;
}

.product-name {
    font-size: 16px;
    font-weight: 500;
    color: #000;
}

.variation-attributes {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    font-size: 13px;
}

.variation-attributes li {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 3px 0;
}

.attr-label {
    color: #666;
}

.attr-value {
    color: #333;
}

.color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 1px solid #ccc;
    border-radius: 50%;
    vertical-align: middle;
}

.product-sku {
    font-size: 12px;
    color: #666;
}

/* Price, Quantity, Subtotal */
.cart-item-price,
.cart-item-quantity,
.cart-item-subtotal {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.price-label,
.subtotal-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.price-sale {
    color: #ff564f;
    font-weight: 600;
}

.price-regular {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
}
.breakdance-woocommerce .quantity {
    position: relative;
    max-width: 150px !important;
    align-self: stretch;
    width: 100%;
}
.breakdance-woocommerce .out-of-stock:before, .breakdance-woocommerce .woocommerce-error li:before{
    display:none !important;
}
/* ==========================================
   COUPON SECTION
   ========================================== */

.cart-coupon-container {
    background: #f9f9f9;
    border: 0px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    margin: 0px 0px 20px 10px;
}

.coupon-applied {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.coupon-applied:last-child {
    margin-bottom: 0;
}

.coupon-code {
    font-size: 14px;
    font-weight: 500;
}

.remove-coupon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.remove-coupon:hover {
    background-color: #f5f5f5;
}

.remove-coupon img {
    width: 16px;
    height: 16px;
}

/* Coupon Form */
.woocommerce-form-coupon .coupon {
    display: flex;
    gap: 10px;
}

.woocommerce-form-coupon .input-text {
    flex: 1;
    max-width: 200px;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
}

.woocommerce-form-coupon .apply-coupon-btn {
    padding: 12px 24px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.woocommerce-form-coupon .apply-coupon-btn:hover {
    background: #005a87;
}

/* ==========================================
   CART SUMMARY
   ========================================== */

.cart-summary {
    /* background: #f9f9f9; */
    /* border: 1px solid #e0e0e0; */
    /* border-radius: 8px; */
    padding: 20px 10px;
    justify-items: flex-end;
    width: stretch;
}

.woocommerce-cart-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.woocommerce-cart-summary p {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    font-size: 15px;
}

.woocommerce-cart-summary p:last-child {
    font-size: 18px;
    font-weight: 600;
    padding-top: 12px;
    border-top: 2px solid #e0e0e0;
}

/* ==========================================
   CHECKOUT BUTTON
   ========================================== */

.cart-checkout-button {
    margin-top: 20px;
    text-align: right;
}

.cart-checkout-button .bde-button__button {
    display: inline-block;
    padding: 15px 40px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.cart-checkout-button .bde-button__button:hover {
    background: #005a87;
}

/* ==========================================
   RESPONSIVE: TABLET (min-width: 600px)
   ========================================== */

@media screen and (min-width: 600px) {
    .cart-item-content {
        grid-template-columns: 100px 1fr;
        grid-template-rows: auto auto;
        gap: 20px;
    }

    .cart-item-thumbnail {
        grid-row: 1 / 3;
        max-width: 100px;
        margin: 0;
    }

    .cart-item-details {
        grid-column: 2;
    }

    .cart-item-price,
    .cart-item-quantity,
    .cart-item-subtotal {
        grid-column: 2;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .cart-skeleton-content {
        grid-template-columns: 100px 1fr auto auto auto;
        align-items: center;
    }
}

/* ==========================================
   RESPONSIVE: DESKTOP (min-width: 800px)
   ========================================== */

@media screen and (min-width: 800px) {
    .cart-item-content {
        grid-template-columns: 120px 1fr auto auto auto;
        grid-template-rows: 1fr;
        align-items: center;
        gap: 25px;
    }

    .cart-item-thumbnail {
        grid-row: 1;
        max-width: 120px;
    }

    .cart-item-details {
        grid-column: 2;
        max-width: 350px;
    }

    .cart-item-price,
    .cart-item-quantity,
    .cart-item-subtotal {
        grid-column: auto;
        flex-direction: column;
        align-items: flex-end;
    }

    .woocommerce-form-coupon .input-text {
        max-width: 250px;
    }

    .cart-checkout-button .bde-button__button {
        width: auto;
    }

    .cart-skeleton-content {
        grid-template-columns: 120px 1fr 100px 80px 120px;
    }
}

/* ==========================================
   WOOCOMMERCE PRICE OVERRIDES
   ========================================== */

.breakdance-woocommerce del .woocommerce-Price-amount bdi,
.breakdance-woocommerce del .woocommerce-Price-amount,
.breakdance-woocommerce del {
    display: inline;
    font-weight: 500;
    font-size: 15px;
    color: #999 !important;
}

.breakdance-woocommerce ins {
    text-decoration: none;
    display: inline;
    color: #ff564f !important;
}

.breakdance-woocommerce ins .woocommerce-Price-amount bdi {
    color: #ff564f !important;
}

.awdr_cart_strikeout_line {
    display: grid;
    justify-content: end;
    gap: 0;
    padding: 0;
    margin: 0;
}

/* ==========================================
   MOBILE SPECIFIC OVERRIDES (max-width: 800px)
   ========================================== */

@media screen and (max-width: 800px) {
    .woocommerce-form-coupon .input-text {
        width: 100%;
        max-width: none;
    }

    .cart-checkout-button .bde-button__button {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================
   ADDITIONAL CART STYLES (from inline extraction)
   ========================================== */

/* Coupon notice and error messages */
.woocommerce-message,
.woocommerce-error {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    list-style: none;
}

.woocommerce-message {
    background-color: #f0f9ff;
    border-left: 0px solid #3b82f6;
    color: #1e40af;
}

.woocommerce-error {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.woocommerce-error li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Cart item container extended styles */
.cart-item-container {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    width: 100%;
    border: 1px solid #f7f5f7;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Desktop cart footer */
@media screen and (min-width: 800px) {
    .dcart-item-footer {
        display: flex;
        gap:20px;
    }
    
    .mcart-item-footer {
        display: none;
    }

    .cart-item-details {
        flex: 1;
        min-width: 350px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/* Mobile cart footer */
@media screen and (max-width: 800px) {
    .mcart-item-footer {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .dcart-item-footer {
        display: none;
    }
    
    .cart-item-price, 
    .cart-item-quantity, 
    .cart-item-subtotal {
        text-align: left;
    }
    
    .cartemob {
        display: grid;
        gap: 5px;
    }
    
    .cart-item-thumbnail {
        width: 25%;
    }
    
    .mobcart {
        width: 68%;
    }
    
    #coupon_code {
        width: 60%;
        border: 0px;
    }
    
    .breakdance-woocommerce .quantity {
        position: relative;
        max-width: 100%;
        align-self: stretch;
    }
    
    .cart-coupon-container {
        text-align: right;
        width: 100%;
        justify-self: end;
        background-color: white;
        border-radius: 50px;
    }
    
    .woocommerce-form-coupon .input-text {
        width: 70%;
        padding: 15px 15px 15px 15px !important;
        border: 0px solid #ccc;
        border-radius: 50px !important;
        font-size: 13px;
        font-weight: 600;
    }
}

/* Additional tablet styles */
@media only screen and (min-width: 750px) {
    .cartte {
        width: 100%;
        display: flex;
        gap:20px;
    }
}

/* Price and product styling */
.cart-item-price, 
.cart-item-quantity, 
.cart-item-subtotal {
    flex: 1;
    text-align: center;
    display: grid;
    align-content: center;
    font-size: 14px;
}

.custom-regular-price {
    font-size: 16px;
    color: #000;
}

.custom-sale-price {
    color: red !important;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
}

/* Quantity input */
.breakdance-woocommerce .quantity {
    position: relative;
    max-width: 160px;
    align-self: stretch;
}

/* Thumbnail */
.cart-item-thumbnail img {
    max-width: 100px;
    border-radius: 8px;
    margin-right: 15px;
}

/* Coupon code input */
#coupon_code {
    width: 200px;
    border: 0px;
}

/* Custom cart container */
.custom-cart-container {
    width: 100%;
    display: grid;
    gap: 20px;
}

/* Coupon container */
.cart-coupon-container {
    text-align: right;
    width: auto;
    justify-self: end;
    background-color: white;
    border-radius: 50px;
}

.coupon-applied {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: #fff;
    border-radius: 50px;
    border: 1px solid #f0f0f0;
}

.coupon-code {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-transform: uppercase;
}

.remove-coupon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
    background-color: black;
    border-radius: 50px;
}

.remove-coupon:hover {
    opacity: 0.6;
}

.remove-icon {
    width: 16px;
    height: 16px;
    display: block;
}

/* Cart summary */
.cart-summary {
    justify-items: end;
    width: auto;
}

/* Skeleton Loader extended */
.cart-item-container.loading {
    position: relative;
    pointer-events: none;
}

/* Cart Skeleton Overlay - Covers actual content during loading */
.cart-skeleton-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10;
    border-radius: 8px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-skeleton-overlay .cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cart-skeleton-overlay .dcart-item-footer,
.cart-skeleton-overlay .mcart-item-footer {
    display: flex;
    gap: 20px;
    flex: 1;
}

.cart-skeleton-overlay .cartte,
.cart-skeleton-overlay .mobcart {
    display: flex;
    gap: 20px;
    flex: 1;
    align-items: center;
}

.cart-skeleton-overlay .cart-item-details {
    flex: 1;
    min-width: 200px;
}

/* Mobile skeleton adjustments */
@media screen and (max-width: 800px) {
    .cart-skeleton-overlay .dcart-item-footer,
    .cart-skeleton-overlay .mcart-item-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .cart-skeleton-overlay .cartte,
    .cart-skeleton-overlay .mobcart {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .cart-skeleton-overlay .cart-item-details {
        width: 100%;
        min-width: unset;
    }
}

/* Preload Skeleton - Shows immediately on page load */
.cart-preload-skeleton {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.cart-preload-skeleton .cart-item-container {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    min-height: 180px;
}

/* NOTE: Skeleton loader styles moved to unified-skeleton.css */
/* Cart now uses unified skeleton loader system for consistent design */

/* Loading Spinner */
.cart-spinner {
    position: fixed;
    z-index: 9999;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: white;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 30px;
    border-radius: 10px;
    text-align: center;
    display: none;
}

/* Custom shipping block */
#custom_shipping_block {
    display: none;
}

/* Cart item price overrides */
.cart-item-price .custom-regular-price bdi {
    color: #000 !important;
    font-weight: 500;
}

.cart-item-price .custom-sale-price bdi {
    color: red !important;
}

/* Variation attributes */
.variation-attributes {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    font-size: 14px;
    color: #333;
}

.variation-attributes li {
    margin: 0px 0px;
    display: flex;
    align-items: self-end;
}

.color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 1px solid #ccc;
    margin: 0px 5px;
    border-radius: 50%;
    vertical-align: middle;
}

.atrbvalue {
    font-size: 13px;
    margin: 0 0px;
}

/* Discount strikeout */
.awdr_cart_strikeout_line {
    display: grid;
    justify-content: end;
    gap: 0;
    padding: 0;
    margin: 0;
}

/* WooCommerce price styling overrides */
.breakdance-woocommerce del .woocommerce-Price-amount bdi, 
.breakdance-woocommerce del .woocommerce-Price-amount, 
.breakdance-woocommerce del {
    display: inline;
    font-weight: 500;
    font-size: 15px;
}

.breakdance-woocommerce ins {
    text-decoration: none;
    display: inline;
    color: red !important;
    margin-top: -20px;
}

.breakdance-woocommerce del .woocommerce-Price-amount bdi {
    color: black !important;
}

.breakdance-woocommerce ins .woocommerce-Price-amount bdi {
    color: #ff564f !important;
}

.breakdance-woocommerce del .woocommerce-Price-amount bdi span.woocommerce-Price-currencySymbol {
    color: black !important;
}

.breakdance-woocommerce ins .woocommerce-Price-amount bdi span.woocommerce-Price-currencySymbol {
    color: #ff564f !important;
}

/* Breakdance button mobile override */
@media screen and (max-width: 768px) {
    .breakdance .bde-preset-f3032e96-1cba-4f49-86d0-e61992376b4f .bde-button__button {
        width: 100%;
    }
}

/* Coupon form styling for desktop */
.woocommerce-form-coupon .coupon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.woocommerce-form-coupon .input-text {
    flex: 1;
    max-width: 200px;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.woocommerce-form-coupon .apply-coupon-btn {
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.woocommerce-form-coupon .apply-coupon-btn:hover {
    background: #005a87;
}
