﻿:root {
    --primary-color: #0071bc;
    --accent-color: #2ecc71;
    --accent-dark: #27ae60;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --bg-light: #f5f7fa;
    --bg-highlight: #fff8e6;
    --discount-green: #008a3e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-color);
    /*background-color: var(--bg-light) !important;*/
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

.cart-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Main content */
.page-title {
    margin: 20px 0 12px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
}

/* Cart layout */
.cart-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px !important;
    margin-bottom: 28px !important;
}

/* Cart items */
.cart-items {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    overflow: hidden;
}

.cart-header {
    display: grid;
    grid-template-columns: minmax(0, 6fr) /* Product - wide */
    minmax(60px, 1fr) /* Quantity - smaller share */
    minmax(80px, 0.8fr) /* Sq.Ft - a bit bigger */
    minmax(90px, 0.8fr) /* Price */
    minmax(90px, 0.8fr) /* Shipping */
    minmax(100px, 0.8fr) /* Total */
    minmax(40px, 0.5fr); /* Action button */    
    padding: 8px 12px !important;
    background-color: #f0f0f0;
    font-weight: 500;
    font-size: 0.75rem !important;
}

.cart-item {
    display: grid;
    grid-template-columns: minmax(0, 6fr) /* Product - wide */
    minmax(60px, 1fr) /* Quantity - smaller share */
    minmax(80px, 0.8fr) /* Sq.Ft - a bit bigger */
    minmax(90px, 0.8fr) /* Price */
    minmax(90px, 0.8fr) /* Shipping */
    minmax(100px, 0.8fr) /* Total */
    minmax(40px, 0.5fr); /* Action button */
    padding: 12px !important;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.cart-header > div:last-child,
.cart-item > div:last-child {
    justify-self: end;
}

/* Align text in cart grid without changing layout */
    .cart-header > div:nth-child(4),
    .cart-header > div:nth-child(5),
    .cart-header > div:nth-child(6),
    .cart-item > div:nth-child(4),
    .cart-item > div:nth-child(5),
    .cart-item > div:nth-child(6),
    .cart-item > div:nth-child(7) {
        text-align: right;
    }

.cart-header > div:nth-child(2),
.cart-header > div:nth-child(3),
.cart-item > div:nth-child(2),
.cart-item > div:nth-child(3) {
    text-align: left;
}

.cart-header > div:first-child,
.cart-item > div:first-child {
    text-align: left;
}


.cart-item:last-child {
    border-bottom: none;
}

.product-info {
    display: flex;
    gap: 8px !important;
    align-items: center;
    min-width: 0; /* For text truncation */
}

.product-image {
    flex-shrink: 0;
    width: 60px !important;
    height: 60px !important;
    background-color: #f0f0f0;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
}

.product-details {
    min-width: 0;
}

.product-details h3 {
    font-size: 0.70rem !important;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-specs {
    color: var(--text-light);
    font-size: 0.70rem !important;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-link {
    color: var(--primary-color);
    font-size: 0.65rem !important;
    text-decoration: none;
}

.quantity-input {
    width: 50px;
    height: 32px !important;
    font-size: 0.65rem !important;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    margin: 0;
}

.item-price, .item-total {
    font-size: 0.7rem !important;
}

.item-total {
    font-weight: 600;
}

.remove-btn {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
    transition: all 0.2s;
    font-size: 10px;
}

    .remove-btn:hover {
        background-color: #f8f8f8;
        color: #ff3b30;
    }

/* Shipping section */
.shipping-info {
    background-color: white;
    border-radius: 4px;
    padding: 12px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.section-title {
    font-size: 0.8rem !important;
    font-weight: 500;
    margin-bottom: 12px !important;
}

.cart-form-row {
    display: flex;
    gap: 12px !important;
    margin-bottom: 12px !important;
}

.cart-form-group {
    flex: 1;
    min-width: 0; /* For proper flex behavior */
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.75rem !important;
    font-weight: 500;
}

.form-control {
    width: 100%;
    height: 36px !important;
    padding: 0 10px !important;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem !important;
}

/* Order summary */
.order-summary {
    background-color: white;
    border-radius: 4px;
    padding: 12px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0 !important;
    font-size: 0.85rem !important;
}

.savings-row {
    margin: 12px -12px !important;
    padding: 8px 12px !important;
    background-color: var(--bg-highlight);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.savings-label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem !important;
}

.info-icon {
    color: var(--text-light);
    cursor: help;
}

.savings-value {
    color: var(--discount-green);
    font-weight: 600;
    font-size: 0.75rem !important;
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 12px 0 !important;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0 !important;
}

.total-label {
    font-size: 1.0rem !important;
    font-weight: 600;
}

.total-value {
    font-size: 1.1rem !important;
    font-weight: 600;
}

.checkout-btn {
    display: block;
    width: 100%;
    padding: 9px !important;
    margin-top: 12px !important;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem !important;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .checkout-btn:hover, .checkout-btn:active {
        background-color: var(--accent-dark);
    }

.continue-link {
    display: inline-flex;
    align-items: center;
    margin-top: 12px !important;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.75rem !important;
}

    .continue-link i {
        margin-right: 4px;
    }

/* Help box */
.help-box {
    background-color: #f0f0f0;
    border-radius: 4px;
    padding: 8px !important;
    margin-top: 12px !important;
}

.help-text {
    display: flex;
    align-items: center;
    font-size: 0.7rem !important;
    flex-wrap: wrap;
    gap: 4px;
}

.help-link {
    color: var(--primary-color);
    text-decoration: none;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

    .tooltip .tooltip-text {
        visibility: hidden;
        width: 180px !important;
        background-color: #333;
        color: #fff;
        text-align: center;
        border-radius: 4px;
        padding: 6px !important;
        position: absolute;
        z-index: 1;
        bottom: 125%;
        left: 50%;
        transform: translateX(-50%);
        opacity: 0;
        transition: opacity 0.3s;
        font-size: 0.75rem !important;
        pointer-events: none;
    }

        .tooltip .tooltip-text::after {
            content: "";
            position: absolute;
            top: 100%;
            left: 50%;
            margin-left: -5px;
            border-width: 5px;
            border-style: solid;
            border-color: #333 transparent transparent transparent;
        }

    .tooltip:hover .tooltip-text {
        visibility: visible;
        opacity: 1;
    }

/* Mobile price labels - hidden by default */
.mobile-label {
    display: none;
    font-weight: 500;
    margin-right: 8px;
}

/* Responsive styles */
@media (min-width: 992px) {
    .cart-container {
        padding: 0 24px;
    }

    .cart-wrapper {
        grid-template-columns: 2fr 1fr;
    }
}

@media (max-width: 991px) {
    .order-summary {
        margin-bottom: 20px !important;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-list {
        display: none;
        flex-direction: column;
        width: 100%;
    }

        .nav-list.active {
            display: flex;
        }

    .cart-form-row {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .cart-header {
        display: none;
    }

    .cart-item {
        grid-template-columns: 1fr;
        gap: 8px !important;
        padding: 12px !important;
    }

    .product-info {
        grid-column: 1 / -1;
    }

    .item-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .mobile-label {
        display: inline;
    }

    .item-qty-row,
    .item-sqaure-row,
    .item-price-row,
    .item-total-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        font-size: 15px;
    }

    /* make values stick to the right, not drop to new line */
    .item-qty-row > div,
    .item-sqaure-row > div,
    .item-price-row > div,
    .item-total-row > div {
        margin-left: auto; /* push value to the right */
        text-align: left;
    }

    .quantity-input {
        width: 50px !important;
    }

    .quantity-wrapper {
        display: flex;
        align-items: center;
    }

    .remove-btn-container {
        display: flex;
        justify-content: flex-end;
        width: 100%;
    }

    .remove-btn {
        font-size: 10px; /* shrink the icon inside */
        
    }
}

@media (max-width: 400px) {
    .page-title {
        font-size: 1.0rem !important;
    }

    .product-image {
        width: 50px !important;
        height: 50px !important;
    }

    .savings-row {
        padding: 8px !important;
        font-size: 0.8rem !important;
    }

    .total-value {
        font-size: 1rem !important;
    }

    .checkout-btn {
        padding: 10px;
        font-size: 0.9rem !important;
    }

    .savings-label {
        font-size: 0.7rem !important;
    }
    .savings-value {
        font-size: 0.7rem !important;
    }
}

/* Touch-friendly adjustments */
@media (pointer: coarse) {
    .remove-btn, .apply-btn, .checkout-btn, .nav-list a {
        min-height: 24px !important;
        min-width: 24px !important;
    }

    .quantity-input {
        min-height: 40px !important;
        min-width: 40px !important;
    }

    .form-control {
        min-height: 40px !important;
    }
}

/* Only affect the informational shipping-info block paragraphs */
.shipping-details p {
    margin-bottom: 12px;
    line-height: 1.5;
    word-break: break-word;
}

/* Lists inside shipping-info */
.shipping-details ol {
    margin: 8px 0 12px 20px;
    padding: 0;
}

/* On small screens: ensure text wraps cleanly */
@media (max-width: 640px) {
    .shipping-details {
        font-size: 14px; /* slightly smaller text */
    }

    .shipping-details p,
    .shipping-details ol {
        margin-bottom: 10px;
    }

    .shipping-details br {
        display: none; /* remove forced line breaks that create gaps */
    }
}


/* Desktop keeps them spaced */
.continue-orders {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* Mobile: stack vertically, center aligned */
@media (max-width: 640px) {
    .continue-orders {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }

    .continue-orders a {
        font-size: 14px;
    }
}


.checkout-btn:focus{
    outline: none; /* removes the default black outline */
    box-shadow: 0 0 0 3px rgba(0, 113, 188, 0.4); /* optional custom focus ring */
}

/* =========================
   Skeleton Loader (Cart)
   ========================= */

#cart-ajax-host.is-loading {
    pointer-events: none;
}

.cart-skeleton .skeleton-line,
.cart-skeleton .skeleton-box,
.cart-skeleton .skeleton-circle,
.cart-skeleton .skeleton-btn {
    background: #e9edf3;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

    .cart-skeleton .skeleton-line::after,
    .cart-skeleton .skeleton-box::after,
    .cart-skeleton .skeleton-circle::after,
    .cart-skeleton .skeleton-btn::after {
        content: "";
        position: absolute;
        top: 0;
        left: -60%;
        width: 60%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
        animation: cartShimmer 1.1s infinite;
    }

@keyframes cartShimmer {
    0% {
        left: -60%;
    }

    100% {
        left: 120%;
    }
}

.cart-skeleton .skeleton-box {
    width: 60px;
    height: 100px;
}

.cart-skeleton .skeleton-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    justify-self: end;
}

.cart-skeleton .skeleton-btn {
    width: 100%;
    height: 40px;
    border-radius: 4px;
}

.cart-skeleton .skeleton-line {
    height: 12px;
    margin: 4px 0;
}

.cart-skeleton .w-30 {
    width: 30%;
}

.cart-skeleton .w-40 {
    width: 40%;
}

.cart-skeleton .w-50 {
    width: 50%;
}

.cart-skeleton .w-60 {
    width: 60%;
}

.cart-skeleton .w-70 {
    width: 70%;
}

.cart-skeleton .w-80 {
    width: 80%;
}

.cart-skeleton .w-90 {
    width: 90%;
}

/* Make skeleton rows taller */
.cart-skeleton .cart-item {
    padding: 18px !important;
    min-height: 110px; /* increase row height */
    align-items: center;
}

/* Make the “image” block taller too */
.cart-skeleton .skeleton-box {
    width: 60px;
    height: 80px; /* increase image skeleton height */
}

/* Make the placeholder lines a bit thicker */
.cart-skeleton .skeleton-line {
    height: 14px; /* was 12px */
    margin: 6px 0;
}

/* Skeleton ONLY: prevent grid stretching */
.cart-wrapper.is-loading {
    align-items: start;
}

    .cart-wrapper.is-loading > * {
        align-self: start;
    }

/* Skeleton only: push money placeholders to the right like real values */
.cart-skeleton .cart-item > div:nth-child(4),
.cart-skeleton .cart-item > div:nth-child(5),
.cart-skeleton .cart-item > div:nth-child(6) {
    justify-self: end;
}
