/* ============================================================
    1. GLOBAL WRAPPERS & UTILITIES
    ============================================================ */
    
/* Container during fragment refresh */
body.updating-cart .x-side-cart-content { 
    opacity: 0.5; 
    filter: blur(2px);
    pointer-events: none;
    position: relative;
}

/* The Spinner Overlay */
.dg-sticky-cart.updating::before {
    content: "";
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    margin-left: -15px;
    border-radius: 50%;
    border: 3px solid #f3f3f3;
    border-top-color: #1B4332; /* Your brand green */
    animation: dg-spinner 0.6s linear infinite;
    z-index: 999;
}

/* Spinner Animation */
@keyframes dg-spinner {
    to { transform: rotate(360deg); }
}

#js-add-bundle:disabled {
    cursor: not-allowed;
    background-color: #cbd5e1 !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
    position: relative;
}

/* Optional: Add a tiny dots animation after the text */
#js-add-bundle:disabled::after {
    content: "...";
    display: inline-block;
    width: 15px;
    text-align: left;
    animation: dg-dots 1.5s steps(3, end) infinite;
}

@keyframes dg-dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60% { content: "..."; }
}
    
.dg-full-wrapper {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: #f9f8f6;
    padding: 40px 0 100px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.dg-limit-width {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');

/* ============================================================
    2. HEADER & PROGRESS BAR (TRUCK & GLOW FIXES)
    ============================================================ */
.dg-header-area { text-align: center; margin-bottom: 50px; }

.dg-title { 
    font-family: 'Playfair Display', serif; 
    font-size: clamp(32px, 5vw, 48px); 
    margin-bottom: 10px; 
    font-weight: 800;
    letter-spacing: -0.5px;
}

.dg-prog-container { 
    margin: 38px auto 10px; 
    max-width: 900px;
    position: relative;
}

.dg-prog-bar { 
    height: 6px; 
    background: #e2e8f0; 
    border-radius: 10px; 
    position: relative;
    margin-bottom: 40px; 
}

.dg-prog-fill { 
    height: 100%; 
    background: linear-gradient(90deg, #1b4332, #2d6a4f); 
    width: 0%; 
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(27, 67, 50, 0.3);
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); 
    position: relative;
}

.dg-prog-fill::after {
    content: "";
    position: absolute;
    right: -18px; 
    top: -28px;   
    width: 35px;
    height: 25px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'%3E%3Cpath fill='%231b4332' d='M624 352h-16V243.9c0-12.7-5.1-24.9-14.1-33.9L494 110.1c-9-9-21.2-14.1-33.9-14.1H416V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h48c0 53 43 96 96 96s96-43 96-96h128c0 53 43 96 96 96s96-43 96-96h48c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zM192 464c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zm336 0c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zm48-176H416V144h44.1l99.9 99.9V288z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: all 0.3s ease;
}

.dg-steps-row { 
    display: flex; 
    justify-content: space-between; 
    margin-top: -18px; 
}

.dg-step {
    text-align: center;
    transition: transform 0.3s ease;
    flex: 1;
}

.dg-circle { 
    width: 62px; 
    height: 62px; 
    background: #ffffff !important; 
    border: 2px solid #e2e8f0 !important; 
    border-radius: 50% !important; 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    margin: 0 auto 10px; 
    font-weight: 800; 
    font-size: 24px;
    color: #64748b;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 2;
}

/* ENHANCED ACTIVE STATE: Glow, Scale, and Color Flip */
.dg-step.active .dg-circle { 
    background-color: #1b4332 !important; 
    border: 3px solid #1b4332 !important; 
    color: #ffffff !important; 
    transform: scale(1.09) !important;}

.dg-step-label {
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
    font-weight: 600;
}

.dg-step.active .dg-step-label { 
    color: #1b4332 !important; 
    font-weight: 800 !important; 
}

/* ============================================================
    3. PRODUCT GRID & CARDS (IMAGE FIX)
    ============================================================ */
.dg-flex-box {
    display: flex !important;
    flex-direction: row !important;
    gap: 30px;
}

.dg-left-side { flex: 0 0 77% !important; }
.dg-right-side { flex: 0 0 23% !important; }

.dg-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px;
    margin-bottom: 30px;
}

.dg-item-card { 
    background: #fff; 
    border: 1px solid hsl(220 13% 91%); 
    border-radius: 16px; 
    padding: 16px; 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    transition: all 0.3s ease;
}

.dg-item-card.is-selected {
    border-color: #1b4332 !important;
    background-color: #f0f4f2 !important;
    box-shadow: 0 10px 20px rgba(27, 67, 50, 0.08);
}

.dg-item-img { 
    background: #f8fafc; 
    border-radius: 12px; 
    height: 160px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 15px; 
    overflow: hidden;
    padding: 10px;
}

.dg-item-img img { 
    max-height: 100%; 
    max-width: 100%;
    width: auto; 
    object-fit: contain !important; /* Prevents stretching */
	border-radius:5px;
}

.dg-item-info h3 { font-size: 15px; margin-bottom: 6px; font-weight: 700; color: #1e293b; }
.dg-item-info p { font-size: 12px; color: #64748b; margin-bottom: 15px; }

/* ============================================================
    4. QUANTITY SELECTOR (RE-ENABLED SELECTORS)
    ============================================================ */
.dg-item-foot { 
    display: flex !important; 
    justify-content: space-between !important; 
    align-items: center !important; 
    margin-top: auto;
}

.dg-item-price { font-weight: 800; font-size: 18px; color: #1b4332; }

.dg-item-qty { 
    display: flex !important; 
    align-items: center !important; 
    gap: 4px !important; 
    background: #f1f5f9; 
    border-radius: 10px;
    padding: 2px;
}

.dg-item-qty button { 
    background: #fff !important; 
    border: 1px solid #e2e8f0 !important; 
    width: 30px !important; 
    height: 30px !important; 
    border-radius: 8px !important; 
    cursor: pointer; 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important;
    font-size: 18px !important;
    font-weight: bold !important;
    color: #1e293b !important;
}

.dg-item-qty input.js-qty-input { 
    width: 32px !important; 
    height: 30px !important;
    border: none !important; 
    text-align: center !important; 
    font-weight: 800 !important; 
    background: transparent !important; 
    font-size: 16px !important;
    color: #1e293b !important; 
    display: inline-block !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ============================================================
    5. TOGGLE & SIDEBAR
    ============================================================ */
.dg-sub-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid hsl(220 13% 91%);
    margin-top: 30px;
}

.dg-sub-toggle {
    position: relative; width: 54px; height: 28px; flex-shrink: 0;
}

.dg-sub-toggle input { opacity: 0; width: 0; height: 0; }

.dg-sub-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e2e8f0; border-radius: 34px; transition: .4s;
}

.dg-sub-slider:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px;
    background-color: #fff; border-radius: 50%; transition: .4s;
}

input:checked + .dg-sub-slider { background-color: #1b4332; }
input:checked + .dg-sub-slider:before { transform: translateX(26px); }

.dg-sticky-cart {
    background: #fff;
    padding: 24px;
    border-radius: 20px;
    position: sticky;
    top: 20px;
    border:1px solid hsl(220 13% 91%);
}

.dg-cart-btn { 
    width: 100%; background: #1b4332; color: #fff; border: none; padding: 18px; 
    border-radius: 12px; font-weight: 700; font-size: 16px; margin-top: 20px; cursor: pointer; 
}

/* ============================================================
    6. MOBILE RESPONSIVENESS
    ============================================================ */
/* ============================================================
   FINAL MOBILE FIX: CENTERING CARDS & BUNDLE BOX
   ============================================================ */

@media (max-width: 1000px) {
    /* 1. Force the main wrapper to center everything */
    .dg-flex-box {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important; /* Centers the children horizontally */
        width: 100% !important;
        padding: 0 !important;
    }

    /* 2. Products Section */
    .dg-left-side {
        width: 100% !important;
        max-width: 600px; /* Prevents cards from getting too huge on tablets */
        margin: 0 auto !important;
        padding: 0 15px !important;
    }

    /* 3. The Grid: Centered 2-Column layout */
    .dg-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        justify-content: center !important; /* Centers the grid items */
        width: 100% !important;
        margin-bottom: 40px !important;
    }

    /* 4. Individual Card Centering */
    .dg-item-card {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important; /* Centers everything inside the card */
        text-align: center !important;
        width: 100% !important;
        background: #fff;
        border-radius: 15px;
        overflow: hidden;
		padding:2px !important;
    }

    /* 5. Image Fix */
    .dg-item-img {
        width: 100% !important;
        padding: 10px !important;
		margin-bottom:0px !important;
		height:170px !important;
    }

    .dg-item-img img {
        width: 100% !important;
        height: 200px !important;
        border-radius: 10px;
		object-fit:cover !important;
    }

    /* 6. Bundle / Cart Box Section (Now appearing exactly under) */
    .dg-right-side {
        width: 100% !important;
        max-width: 500px;
        margin: 0 auto !important;
        padding: 0 20px 40px !important;
        display: block !important;
    }

    /* 7. Footer/Price/Qty alignment */
    .dg-item-foot {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100%;
        padding-bottom: 15px !important;
    }

    .dg-item-qty {
        justify-content: center !important;
        width: auto !important;
    }
}

/* Fix for Heading */
.dg-label {
    text-align: center !important;
    width: 100%;
    margin: 30px 0 !important;
}