/* ============================================================
   PRINTIGLY THEME — Cart Page Styles
   Matches mockup-cart.html design
   ============================================================ */

/* === PAGE TITLE === */
.cart-page-title {
    background: var(--bg-white);
    padding: 32px 0 28px;
}

.cart-page-title h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.cart-page-title .subtitle {
    font-size: 15px;
    color: var(--text-gray);
    font-weight: 500;
}

/* === CART LAYOUT (2-column) === */
.printigly-cart-section {
    padding: 32px 0 60px;
}

.printigly-cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}

/* === CART ITEMS COLUMN === */
.cart-items-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* === INDIVIDUAL CART ITEM CARD === */
.cart-item-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.cart-item-card:hover {
    box-shadow: var(--shadow-md);
}

.cart-item-thumb {
    width: 80px;
    height: 80px;
    min-width: 80px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
}

.cart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.cart-item-name a {
    color: inherit;
    text-decoration: none;
}

.cart-item-name a:hover {
    color: var(--printigly-primary);
}

.cart-item-remove {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg-light);
    color: #999;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1;
}

.cart-item-remove:hover {
    background: #fde8e8;
    color: #E94536;
}

.cart-item-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 6px;
    line-height: 1.5;
}

.cart-item-meta dl {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
}

.cart-item-meta dt {
    font-weight: 600;
    color: #666;
}

.cart-item-meta dt::after {
    content: ':';
}

.cart-item-meta dd {
    margin: 0;
}

.cart-item-meta dd::after {
    content: '|';
    margin: 0 6px;
    color: #ccc;
}

.cart-item-meta dd:last-child::after {
    display: none;
}

.cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
}

/* === QTY × PRICE LINE === */
.cart-item-qty-line {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    white-space: nowrap;
}

.cart-item-line-total {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-dark);
    white-space: nowrap;
}

/* === TIER NUDGE BANNER === */
.cart-tier-nudge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #eef9f1 0%, #e6f7ec 100%);
    border: 1px solid #c3e8d0;
    border-radius: 8px;
}

.tier-nudge-text {
    font-size: 13px;
    font-weight: 600;
    color: #1a7a3a;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.5;
}

.tier-nudge-text i {
    font-size: 14px;
    color: #30AD6E;
}

.tier-nudge-save {
    background: #30AD6E;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.tier-nudge-btn {
    flex-shrink: 0;
    padding: 6px 18px;
    background: #30AD6E;
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tier-nudge-btn:hover {
    background: #279a5e;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(48, 173, 110, 0.3);
}

/* === COUPON & ACTIONS === */
.cart-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.cart-coupon-form {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 400px;
}

.cart-coupon-form input[type="text"] {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--printigly-font);
    font-size: 14px;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.3s ease;
}

.cart-coupon-form input[type="text"]::placeholder {
    color: #aaa;
}

.cart-coupon-form input[type="text"]:focus {
    border-color: var(--printigly-primary);
}

.cart-coupon-form button {
    padding: 10px 24px;
    border: 2px solid var(--printigly-primary);
    border-radius: 8px;
    background: transparent;
    color: var(--printigly-primary);
    font-family: var(--printigly-font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cart-coupon-form button:hover {
    background: var(--printigly-primary);
    color: #fff;
}

.continue-shopping-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--printigly-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.continue-shopping-link:hover {
    color: var(--printigly-primary);
    gap: 10px;
}

/* === ORDER SUMMARY SIDEBAR === */
.cart-order-summary {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 28px;
    position: sticky;
    top: 104px;
}

.cart-summary-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 14px;
}

.cart-summary-row .label {
    color: #666;
    font-weight: 500;
}

.cart-summary-row .value {
    font-weight: 600;
    color: var(--text-dark);
}

.cart-summary-row .value.free {
    color: #30AD6E;
    font-weight: 700;
}

.cart-summary-row .value.discount {
    color: #30AD6E;
    font-weight: 700;
}

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

.cart-summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cart-summary-total .label {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-dark);
}

.cart-summary-total .value {
    font-size: 24px;
    font-weight: 800;
    color: var(--printigly-primary);
}

.cart-savings-badge {
    font-size: 13px;
    font-weight: 600;
    color: #30AD6E;
    background: #e6f9ed;
    padding: 8px 14px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.btn-checkout-main {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--printigly-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--printigly-font);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    letter-spacing: 0.3px;
    text-decoration: none;
}

.btn-checkout-main:hover {
    background: #e85a24;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.4);
}

.btn-checkout-main:active {
    transform: translateY(0);
}

/* Secure Checkout Area */
.cart-secure-info {
    margin-top: 20px;
    text-align: center;
}

.cart-secure-label {
    font-size: 13px;
    color: #888;
    font-weight: 600;
    margin-bottom: 10px;
}

.cart-payment-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.cart-payment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #555;
    letter-spacing: 0.3px;
}

.cart-help-text {
    font-size: 13px;
    color: #666;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.cart-help-text a {
    color: var(--printigly-secondary);
    font-weight: 700;
}

.cart-help-text a:hover {
    color: var(--printigly-primary);
}

/* === UPLOAD STATUS (in cart items) === */
.cart-item-upload {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 6px;
}

.cart-item-upload.uploaded {
    color: #30AD6E;
}

.cart-item-upload.needed {
    color: var(--printigly-primary);
}

.cart-item-upload.needed a {
    color: var(--printigly-primary);
    text-decoration: underline;
}

.cart-item-upload.needed a:hover {
    color: #e85a24;
}

/* === DESIGN UPLOAD MODAL === */
.cart-upload-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10200;
    align-items: center;
    justify-content: center;
}

.cart-upload-modal.open {
    display: flex;
}

.cart-upload-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cart-upload-modal__panel {
    position: relative;
    background: var(--bg-white);
    border-radius: 16px;
    padding: 28px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.25s ease;
}

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

.cart-upload-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.cart-upload-modal__header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.cart-upload-modal__header h3 i {
    color: var(--printigly-primary);
}

.cart-upload-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-light);
    border-radius: 50%;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cart-upload-modal__close:hover {
    background: #fde8e8;
    color: #E94536;
}

.cart-upload-modal__product-name {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    font-weight: 500;
}

.cart-upload-modal__dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-upload-modal__dropzone:hover,
.cart-upload-modal__dropzone.dragover {
    border-color: var(--printigly-primary);
    background: rgba(255, 107, 53, 0.04);
}

.dropzone-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dropzone-idle i {
    font-size: 36px;
    color: #ccc;
}

.dropzone-idle span {
    font-size: 14px;
    color: #666;
}

.dropzone-idle strong {
    color: var(--printigly-primary);
    cursor: pointer;
}

.dropzone-idle small {
    font-size: 12px;
    color: #aaa;
}

.dropzone-progress {
    width: 100%;
    text-align: center;
}

.dropzone-progress__bar {
    width: 100%;
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.dropzone-progress__fill {
    height: 100%;
    width: 0;
    background: var(--printigly-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.dropzone-progress__text {
    font-size: 13px;
    color: #888;
    font-weight: 600;
}

.dropzone-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dropzone-success i {
    font-size: 40px;
    color: #30AD6E;
}

.dropzone-success__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-all;
}

.dropzone-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dropzone-error i {
    font-size: 36px;
    color: #E94536;
}

.dropzone-error__text {
    font-size: 13px;
    color: #E94536;
    font-weight: 600;
}

/* === CROSS-SELLS / YOU MAY ALSO LIKE === */
.cart-cross-sells {
    padding: 0 0 60px;
}

.cart-cross-sells h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.cart-cross-sells .products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.cart-cross-sells .products li.product {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.35s ease;
    position: relative;
}

.cart-cross-sells .products li.product:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.cart-cross-sells .products li.product a img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    width: 100%;
    display: block;
}

.cart-cross-sells .products li.product .woocommerce-loop-product__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    padding: 12px 16px 4px;
    margin: 0;
    line-height: 1.35;
}

.cart-cross-sells .products li.product .price {
    font-size: 16px;
    font-weight: 800;
    color: var(--printigly-primary);
    padding: 0 16px 16px;
}

.cart-cross-sells .products li.product .button {
    display: none;
}

/* === EMPTY CART STATE === */
.printigly-empty-cart {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.empty-cart-icon {
    font-size: 72px;
    color: #ddd;
    margin-bottom: 24px;
}

.empty-cart-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-cart-text {
    font-size: 16px;
    color: #888;
    margin-bottom: 32px;
}

.empty-cart-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-browse-products {
    padding: 14px 32px;
    background: var(--printigly-primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: var(--printigly-font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-browse-products:hover {
    background: #e85a24;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.35);
}

.btn-view-bestsellers {
    padding: 14px 32px;
    background: transparent;
    color: var(--printigly-primary);
    border: 2px solid var(--printigly-primary);
    border-radius: 50px;
    font-family: var(--printigly-font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-view-bestsellers:hover {
    background: var(--printigly-primary);
    color: #fff;
    transform: translateY(-2px);
}

/* === MOBILE BOTTOM CHECKOUT BAR === */
.cart-mobile-bottom {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.cart-mobile-bottom .btn-checkout-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 12px;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
}

.cart-mobile-bottom .mobile-checkout-total {
    font-weight: 400;
    opacity: 0.9;
    font-size: 0.85rem;
}

/* === HIDE WC DEFAULT CART ELEMENTS (our template renders custom ones) === */
.woocommerce-cart .cart_totals,
.woocommerce-cart .shop_table.shop_table_responsive.cart,
.woocommerce-cart .woocommerce-shipping-calculator {
    display: none !important;
}


/* === WC NOTICES (cart-specific) === */
.woocommerce-cart .woocommerce-notices-wrapper {
    margin-bottom: 16px;
}

/* === RESPONSIVE: 1024px === */
@media (max-width: 1024px) {
    .printigly-cart-layout {
        grid-template-columns: 1fr 340px;
        gap: 24px;
    }
}

/* === RESPONSIVE: 768px === */
@media (max-width: 768px) {
    .cart-cross-sells .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .cart-page-title h1 {
        font-size: 26px;
    }

    .printigly-cart-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .cart-order-summary {
        position: static;
    }

    .cart-item-card {
        padding: 16px;
        gap: 14px;
    }

    .cart-item-bottom {
        flex-wrap: wrap;
        gap: 8px;
    }

    .cart-coupon-form {
        max-width: 100%;
        width: 100%;
    }

    .cart-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .continue-shopping-link {
        text-align: center;
        justify-content: center;
    }

    .cart-mobile-bottom {
        display: block;
    }

    body.woocommerce-cart {
        padding-bottom: 80px;
    }

    /* Hide the desktop checkout button on mobile (use bottom bar instead) */
    .cart-order-summary .btn-checkout-main {
        display: none;
    }
}

/* === RESPONSIVE: 480px === */
@media (max-width: 480px) {
    .cart-tier-nudge {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        text-align: center;
    }

    .tier-nudge-text {
        justify-content: center;
        font-size: 12px;
    }

    .tier-nudge-btn {
        text-align: center;
    }

    .cart-cross-sells .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .cart-cross-sells .products li.product .woocommerce-loop-product__title {
        font-size: 13px;
        padding: 10px 10px 4px;
    }

    .cart-cross-sells .products li.product .price {
        font-size: 13px;
        padding: 0 10px 12px;
    }

    .cart-cross-sells {
        padding: 0 0 40px;
    }

    .cart-cross-sells h2 {
        font-size: 20px;
    }

    .cart-page-title {
        padding: 24px 0 20px;
    }

    .cart-page-title h1 {
        font-size: 22px;
    }

    .printigly-cart-section {
        padding: 20px 0 40px;
    }

    .cart-item-card {
        flex-direction: column;
        gap: 12px;
    }

    .cart-item-thumb {
        width: 100%;
        height: 100px;
    }

    .cart-item-bottom {
        flex-wrap: wrap;
        gap: 4px;
    }

    .cart-order-summary {
        padding: 20px;
    }

    .cart-summary-total .value {
        font-size: 20px;
    }

    .printigly-empty-cart {
        padding: 40px 16px;
    }

    .empty-cart-icon {
        font-size: 56px;
    }

    .empty-cart-title {
        font-size: 22px;
    }

    .empty-cart-text {
        font-size: 14px;
    }
}