/* Section Styles */
.dms-carts {
    margin: 20px auto;
    padding: 20px;
    max-width: 1400px;
}

.dms-carts h2 {
    text-align: center;
    margin: 10px 0px;
    color: #AF1F31;
    font-size: 39px;
    font-weight: 700;
    text-transform: uppercase;
    word-spacing: 1px;
    text-decoration: underline;
    font-family: inherit;
    font-style: normal;
    -webkit-text-stroke-width: 1px;
    stroke-width: 1px;
    -webkit-text-stroke-color: #AF1F31;
    stroke: #AF1F31;
}

.dms-no-carts {
    text-align: center;
    color: #666;
    font-size: 18px;
    padding: 30px 20px;
    margin-bottom: 30px;
    font-family: inherit;
}

/* Grid Layout - 4 columns */
.dms-cart-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* Individual Cart Card */
.dms-cart {
    background: #fff;
    border: 3px solid #e0e0e0;
    /* border-radius: 8px; */
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 3px;
    height: 100%;
}

/* Image wrapper to ensure proper containment */
.dms-cart > img,
.dms-cart > .dms-cart-no-image {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
}

.dms-cart:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Image Container - Ensure consistent sizing */
/* More specific selectors to override Elementor's .elementor img styles */
.dms-carts .dms-cart img,
.elementor .dms-cart img,
.elementor-widget-dms_carts .dms-cart img,
.dms-cart img {
    width: 100% !important;
    max-width: 100% !important;
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

/* No Image Placeholder */
.dms-carts .dms-cart-no-image,
.elementor .dms-cart-no-image,
.elementor-widget-dms_carts .dms-cart-no-image,
.dms-cart-no-image {
    width: 100% !important;
    max-width: 100% !important;
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.dms-cart-no-image span {
    color: #666;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Cart Title */
.dms-cart h3 {
    color: #AF1F31;
    font-size: 18px;
    font-weight: 700;
    /* padding: 18px 15px 8px; */
    margin: 0;
    line-height: 1.4;
    text-align: center;
    font-family: inherit;
    /* min-height: 60px; */
    font-variant: normal !important;
    text-transform: none !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Price */
.dms-cart .price {
    font-size: 0.9rem;
    font-weight: bold;
    color: #0c4774;
    margin: 8px 0 15px;
    text-align: center;
    line-height: 1.3;
    font-weight: 700;
    margin-bottom: .5em;
    font-family: inherit;
}

/* Button - Modern design matching image */
.dms-cart .dms-see-details-btn,
.dms-cart .button.dms-see-details-btn,
.dms-cart .btn {
    background: #AF1F31;
    color: #fff !important;
    border: none;
    padding: 10px 20px;
    margin: 0.5em auto 0.5em auto;
    border-radius: 0px 12px 12px 12px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;                                                                                                                                                                                                                                                                                                                                                       
    width: fit-content;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.dms-cart .dms-see-details-btn:hover,
.dms-cart .button.dms-see-details-btn:hover,
.dms-cart .btn:hover {
    background: #0C4774;
}

/* Shopping Cart Icon - Font Awesome */
.dms-cart .dms-see-details-btn i.fa-solid,
.dms-cart .dms-see-details-btn i.fa-cart-shopping,
.dms-cart .btn i.fa-solid,
.dms-cart .btn i.fa-cart-shopping {
    font-size: 16px;
    display: inline-block;
    color: #fff !important;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    margin: 0;
}

/* Homepage Body Styles */
body.dms-carts-homepage {
    background: #f5f5f5;
}

body.dms-carts-homepage .site-header,
body.dms-carts-homepage .site-footer,
body.dms-carts-homepage .site-main .entry-header,
body.dms-carts-homepage .site-main .entry-content:not(.dms-carts-container) {
    display: none !important;
}

/* Responsive Design */
/* At 1440px and above: 4 carts per row (default) */
/* At 1024px and below: 2 carts per row for ALL smaller screens */
@media (max-width: 1024px) {
    .dms-carts .dms-cart-grid,
    .dms-cart-grid,
    section.dms-carts .dms-cart-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    
    .dms-carts {
        padding: 15px;
    }
    
    .dms-carts h2 {
        font-size: 32px;
    }
    
    /* Cart title - slightly smaller */
    .dms-cart h3 {
        font-size: 17px;
        padding: 16px 12px 8px;
    }
    
    /* Price - keep fixed at 0.9rem (no change) */
    
    /* Button - slightly smaller */
    .dms-cart .dms-see-details-btn {
        padding: 9px 18px;
    }
}

/* Tablet and Mobile - maintain 2 columns */
@media (max-width: 768px) {
    .dms-carts .dms-cart-grid,
    .dms-cart-grid,
    section.dms-carts .dms-cart-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .dms-carts {
        padding: 10px;
    }
    
    .dms-carts h2 {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    .dms-carts .dms-cart img,
    .elementor .dms-cart img,
    .elementor-widget-dms_carts .dms-cart img,
    .dms-cart img {
        height: 250px !important;
        min-height: 250px !important;
        max-height: 250px !important;
    }
    
    .dms-carts .dms-cart-no-image,
    .elementor .dms-cart-no-image,
    .elementor-widget-dms_carts .dms-cart-no-image,
    .dms-cart-no-image {
        height: 250px !important;
        min-height: 250px !important;
        max-height: 250px !important;
    }
    
    /* Cart title - smaller for tablet/mobile */
    .dms-cart h3 {
        font-size: 15px;
        padding: 12px 10px 6px;
    }
    
    /* Price - keep fixed at 0.9rem (no change) */
    
    /* Button - smaller for tablet/mobile */
    .dms-cart .dms-see-details-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .dms-cart .dms-see-details-btn i.fa-solid,
    .dms-cart .dms-see-details-btn i.fa-cart-shopping {
        font-size: 14px;
    }
}

/* Small mobile - STILL maintain 2 columns */
@media (max-width: 570px) {
    .dms-carts .dms-cart-grid,
    .dms-cart-grid,
    section.dms-carts .dms-cart-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .dms-carts {
        padding: 8px;
    }
    
    .dms-carts h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    /* Cart title - even smaller for small mobile */
    .dms-cart h3 {
        font-size: 13px;
        padding: 10px 8px 5px;
    }
    
    /* Price - keep fixed at 0.9rem (no change) */
    
    /* Button - smaller for small mobile */
    .dms-cart .dms-see-details-btn,
    .dms-cart .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        gap: 6px;
    }
    
    .dms-cart .dms-see-details-btn i.fa-solid,
    .dms-cart .dms-see-details-btn i.fa-cart-shopping,
    .dms-cart .btn i.fa-solid,
    .dms-cart .btn i.fa-cart-shopping {
        font-size: 13px;
    }
}

/* ========================================
   Single Cart Detail Page Styles
   ======================================== */

.dms-single-cart-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dms-single-cart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* Sold Banner */
.dms-cart-sold-banner {
    grid-column: 1 / -1;
    background: #AF1F31;
    color: #fff;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 20px;
}

.dms-cart-sold-banner h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

/* Image Gallery */
.dms-cart-gallery {
    position: relative;
}

.dms-gallery-main {
    width: 100%;
    margin-bottom: 20px;
}

.dms-gallery-main img,
.dms-cart-no-image-large {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid #e0e0e0;
}

.dms-cart-no-image-large {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dms-cart-no-image-large span {
    color: #666;
    font-size: 24px;
    font-weight: 600;
}

.dms-gallery-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dms-gallery-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.dms-gallery-thumb:hover,
.dms-gallery-thumb.active {
    border-color: #AF1F31;
}

/* Location Banner */
.dms-location-banner {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(10, 71, 116, 0.9);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
    z-index: 10;
}

/* Cart Information */
.dms-cart-info {
    padding: 20px;
}

.dms-cart-title {
    font-size: 32px;
    font-weight: 700;
    color: #AF1F31;
    margin: 0 0 20px 0;
    font-family: inherit;
}

.dms-cart-color,
.dms-cart-seat-color,
.dms-cart-drivetrain,
.dms-cart-passengers {
    font-size: 16px;
    color: #333;
    margin: 10px 0;
    font-family: inherit;
}

.dms-cart-price {
    font-size: 36px;
    font-weight: 700;
    color: #0c4774;
    margin: 30px 0;
    font-family: inherit;
}

.dms-contact-btn {
    display: inline-block;
    background: #AF1F31;
    color: #fff;
    padding: 15px 40px;
    border-radius: 0px 12px 12px 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    transition: background 0.3s ease;
    font-family: inherit;
}

.dms-contact-btn:hover {
    background: #0c4774;
}

.dms-sold-btn {
    background: #999;
    color: #fff;
    padding: 15px 40px;
    border: none;
    border-radius: 0px 12px 12px 12px;
    font-weight: 700;
    font-size: 18px;
    cursor: not-allowed;
    font-family: inherit;
}

/* Add-ons Section */
.dms-cart-addons {
    grid-column: 1 / -1;
    margin-top: 40px;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    border: 3px solid #e0e0e0;
}

.dms-cart-addons h2 {
    font-size: 28px;
    font-weight: 700;
    color: #AF1F31;
    margin: 0 0 20px 0;
    font-family: inherit;
}

.dms-addons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.dms-addon-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.dms-addon-item:hover {
    border-color: #AF1F31;
    box-shadow: 0 2px 8px rgba(175, 31, 49, 0.1);
}

.dms-addon-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
    display: block;
}

.dms-addon-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 10px 0;
    font-family: inherit;
}

.dms-addon-item .dms-addon-price {
    font-size: 18px;
    font-weight: 700;
    color: #AF1F31;
    margin: 10px 0;
    font-family: inherit;
}

.dms-addon-item label {
    display: block;
    margin-top: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: #333;
}

.dms-addon-item input[type="checkbox"] {
    margin: 0 8px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #AF1F31;
}

.dms-total-price {
    font-size: 24px;
    color: #272727;
    font-family: inherit;
}

.dms-total-price strong {
    font-weight: 700;
}

.dms-total-price #dms-cart-total {
    color: #AF1F31;
}

.dms-no-addons {
    color: #666;
    font-style: italic;
    font-family: inherit;
}

/* Monroney Sticker */
.dms-monroney-sticker {
    grid-column: 1 / -1;
    margin-top: 40px;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.dms-monroney-sticker h2 {
    font-size: 28px;
    font-weight: 700;
    color: #AF1F31;
    margin: 0 0 20px 0;
    font-family: inherit;
}

.dms-monroney-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.dms-monroney-content p {
    margin: 0;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    font-family: inherit;
}

.dms-monroney-content strong {
    color: #0c4774;
}

/* Extended Warranty Banner */
.dms-warranty-banner {
    grid-column: 1 / -1;
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #0c4774 0%, #AF1F31 100%);
    color: #fff;
    border-radius: 8px;
    text-align: center;
}

.dms-warranty-banner h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px 0;
    font-family: inherit;
}

.dms-warranty-banner p {
    font-size: 18px;
    margin: 0 0 20px 0;
    font-family: inherit;
}

.dms-warranty-btn {
    display: inline-block;
    background: #fff;
    color: #0c4774;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    transition: transform 0.3s ease;
    font-family: inherit;
}

.dms-warranty-btn:hover {
    transform: translateY(-2px);
}

/* Not Found */
.dms-cart-not-found {
    text-align: center;
    padding: 60px 20px;
}

.dms-cart-not-found h1 {
    font-size: 36px;
    color: #AF1F31;
    margin-bottom: 20px;
    font-family: inherit;
}

.dms-cart-not-found p {
    font-size: 18px;
    color: #666;
    font-family: inherit;
}

/* Responsive Design for Single Cart */
@media (max-width: 1024px) {
    .dms-single-cart {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .dms-gallery-main img,
    .dms-cart-no-image-large {
        height: 400px;
    }

    .dms-cart-title {
        font-size: 28px;
    }

    .dms-cart-price {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .dms-single-cart-wrapper {
        padding: 20px 15px;
    }

    .dms-single-cart {
        gap: 20px;
    }

    .dms-gallery-main img,
    .dms-cart-no-image-large {
        height: 300px;
    }

    .dms-cart-title {
        font-size: 24px;
    }

    .dms-cart-price {
        font-size: 28px;
    }

    .dms-location-banner {
        position: static;
        margin-bottom: 20px;
    }

    .dms-cart-addons,
    .dms-monroney-sticker,
    .dms-warranty-banner {
        padding: 20px;
    }
}

/* ========================================
   WooCommerce Product Page - DMS Injected Content (via JS)
   ======================================== */

/* ========== PRODUCT IMAGE GALLERY ========== */
.dms-product-gallery {
    width: 100%;
}

.dms-product-main-image {
    width: 100%;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
}

.dms-product-main-image a {
    display: block;
    pointer-events: none; /* Disable link while zooming */
}

.dms-product-main-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.2s ease;
}

/* Zoom Overlay */
.dms-zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-size: 200%; /* 2x zoom */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.dms-product-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.dms-product-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.dms-product-thumb:hover {
    opacity: 0.8;
}

.dms-product-thumb.active {
    border-color: #AF1F31;
}

/* ========== WINDOW STICKER (before Add to Cart) ========== */
.dms-sticker-wrapper {
    margin: 20px 0;
    padding: 0;
}

.dms-sticker-section {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.dms-sticker-frame {
    width: 100%;
    background: #f9f9f9;
    text-align: center;
    position: relative;
}

.dms-sticker-frame canvas {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

#dms-sticker-loading {
    padding: 40px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

/* Sticker Popup/Lightbox */
.dms-sticker-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.dms-sticker-popup {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: block;
}

.dms-sticker-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: #AF1F31;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dms-sticker-popup-close:hover {
    background: #5A0E1A;
}

.dms-sticker-popup-content {
    overflow: auto;
    max-height: 90vh;
}

.dms-sticker-popup-content img {
    display: block;
    max-width: 100%;
    height: auto;
    opacity: 1 !important;
    transition: none !important;
}

.dms-sticker-popup-content img:hover {
    opacity: 1 !important;
}

/* ========== EXTENDED WARRANTY (moved by JS) ========== */
.dms-extended-warranty-addon {
    margin-top: 25px !important;
    padding: 20px !important;
    background: linear-gradient(135deg, #0c4774 0%, #AF1F31 100%) !important;
    border-radius: 8px !important;
    color: #fff !important;
}

.dms-extended-warranty-addon .wc-pao-addon-name,
.dms-extended-warranty-addon label,
.dms-extended-warranty-addon .product-addon-totals,
.dms-extended-warranty-addon p {
    color: #fff !important;
}

.dms-extended-warranty-addon input,
.dms-extended-warranty-addon select {
    color: #333 !important;
    background: #fff !important;
}

/* ========== QUANTITY LABEL IN ADDONS ========== */
.dms-quantity-label {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-right: 8px !important;
    font-weight: 500 !important;
    color: #333 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    vertical-align: middle !important;
}

.wc-pao-addon-wrap .dms-quantity-label,
.product-addon .dms-quantity-label,
.wc-pao-addon .dms-quantity-label,
form.cart .dms-quantity-label,
.quantity .dms-quantity-label {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    vertical-align: middle !important;
}

.quantity {
    padding: 0 2px !important;
    margin: 0 2px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 16px !important;
}

.quantity input.qty {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .dms-product-thumbnails {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .dms-product-thumbnails {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }
}



