/* File: assets/css/custom-addtocart.css */

/* CSS Variables (are set via inline :root from settings) */
/* Fallbacks if variables missing */
:root{
    --atc-primary: #4CAF50;
    --atc-primary-text: #ffffff;
    --atc-primary-hover: #3e8e41;
    
    --atc-buynow: #FF5722;
    --atc-buynow-text: #ffffff;
    --atc-buynow-hover: #e64a19;
    
    --atc-selected-border: #4CAF50;
    --atc-selected-bg: #f8fff8;
    
    --atc-badge-newbie: #2196F3;
    --atc-badge-popular: #FF5722;
    --atc-badge-best-value: #9C27B0;
    --atc-badge-big-saving: #FFC107;
    --atc-badge-text: #ffffff;
    
    --atc-container-bg: #ffffff;
    --atc-container-border: #e0e0e0;
    --atc-container-border-width: 1px;
    --atc-container-border-radius: 10px;
    --atc-container-padding: 20px;
    --atc-container-max-width: 560px;
    
    --atc-sticky-bg: #ffffff;
    --atc-sticky-btn-bg: #4CAF50;
    --atc-sticky-btn-text: #ffffff;
    --atc-sticky-btn-hover: #3e8e41;
    
    --atc-button-padding: 12px;
    --atc-element-spacing: 16px;
    --atc-social-proof-spacing: 8px;
    
    --atc-pack-qty-font-size: 16px;
    --atc-pack-price-font-size: 14px;
    --atc-total-font-size: 18px;
    --atc-social-proof-font-size: 14px;
    --atc-secure-checkout-font-size: 14px;
}

/* Main Container */
.custom-atc-container {
    font-family: 'Arial', sans-serif;
    max-width: var(--atc-container-max-width);
    margin: 0 auto;
    padding: var(--atc-container-padding);
    border: var(--atc-container-border-width) solid var(--atc-container-border);
    border-radius: var(--atc-container-border-radius);
    background: var(--atc-container-bg);
}

/* Seed Packs */
.seed-packs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-bottom: var(--atc-element-spacing);
}
.seed-pack {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fff;
}
.seed-pack:hover { transform: translateY(-2px); }
.seed-pack.selected {
    border-color: var(--atc-selected-border);
    background-color: var(--atc-selected-bg);
}
.seed-pack-badge {
    font-size: 10px;
    font-weight: bold;
    color: var(--atc-badge-text);
    padding: 2px 6px;
    border-radius: 999px;
    margin-bottom: 6px;
    display: inline-block;
}
.seed-pack-badge.newbie { background: var(--atc-badge-newbie); }
.seed-pack-badge.popular { background: var(--atc-badge-popular); }
.seed-pack-badge.best-value { background: var(--atc-badge-best-value); }
.seed-pack-badge.big-saving { background: var(--atc-badge-big-saving); color: #333; }

.seed-pack-qty { 
    font-weight: 700; 
    font-size: var(--atc-pack-qty-font-size); 
}
.seed-pack-price { 
    font-size: var(--atc-pack-price-font-size); 
    color: #333; 
    margin: 6px 0; 
}

/* Summary */
.custom-atc-summary {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    margin: var(--atc-element-spacing) 0; 
    padding: 14px;
    background: #f9f9f9; 
    border-radius: 8px;
}
.custom-atc-total { 
    font-size: var(--atc-total-font-size); 
    font-weight: bold; 
}
.custom-atc-total span { color: var(--atc-primary); }
.custom-atc-quantity { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}
.custom-atc-qty-input {
    width: 70px!important; 
    padding: 6px!important; 
    border: 1px solid #ddd!important; 
    border-radius: 6px!important; 
    text-align: center!important;
}

/* Social Proof */
.social-proof { 
    margin: var(--atc-element-spacing) 5px; 
}
.proof-item { 
    display: flex; 
    align-items: center; 
    margin-bottom: var(--atc-social-proof-spacing); 
    font-size: var(--atc-social-proof-font-size); 
}
.proof-icon { margin-right: 10px; font-size: 16px; }
.proof-item.checked { color: var(--atc-primary); }
.secure-checkout { 
    text-align:center; 
    font-size: var(--atc-secure-checkout-font-size);
    margin: var(--atc-element-spacing) 0;
}

/* Buttons */
.custom-atc-actions {
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
    margin-top: var(--atc-element-spacing);
}
.custom-atc-button, .custom-atc-buynow {
    padding: var(--atc-button-padding); 
    border: none; 
    border-radius: 8px; 
    font-weight: bold;
    cursor: pointer; 
    transition: all 0.25s ease;
}
.custom-atc-button { 
    background: var(--atc-primary); 
    color: var(--atc-primary-text); 
}
.custom-atc-buynow { 
    background: var(--atc-buynow); 
    color: var(--atc-buynow-text); 
}
.custom-atc-button:hover { 
    background: var(--atc-primary-hover); 
}
.custom-atc-buynow:hover { 
    background: var(--atc-buynow-hover); 
}
.custom-atc-button[disabled], 
.custom-atc-buynow[disabled], 
.custom-sticky-button[disabled] {
    opacity: 0.5; 
    cursor: not-allowed;
}

/* Sticky Cart */
.custom-sticky-atc {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0;
    background: var(--atc-sticky-bg); 
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 999; 
    display: none;
}
.custom-sticky-content {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    max-width: 1200px; 
    margin: 0 auto; 
    gap: 20px;
}
.custom-sticky-product { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    flex-wrap: wrap; 
}
.custom-sticky-name { font-weight: 700; }
.custom-sticky-variation { font-size: 13px; opacity: 0.8; }
.custom-sticky-price { font-weight: 700; }
.custom-sticky-button {
    background: var(--atc-sticky-btn-bg); 
    color: var(--atc-sticky-btn-text); 
    border: none; 
    padding: 10px 20px; 
    border-radius: 8px; 
    font-weight: bold; 
    cursor: pointer;
}
.custom-sticky-button:hover {
    background: var(--atc-sticky-btn-hover);
}

/* Responsive */
@media (max-width: 900px) {
    .custom-atc-actions { grid-template-columns: 1fr; }
}

/* ==========================
   Sticky Cart Styles (Compact + Mobile Grid)
   ========================== */
.custom-sticky-atc {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    font-family: Arial, sans-serif;
    display: none;
    font-size: 13px;
}

.custom-sticky-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px; /* ⬅ tighter padding */
    background: rgba(255,255,255,0.1); /* transparency support */
    border-top: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 -1px 4px rgba(0,0,0,0.08);
    gap: 8px;
    flex-wrap: wrap;
}

/* Product info */
.custom-sticky-product {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    min-width: 140px;
}

.custom-sticky-name {
    font-weight: 600;
    color: #111;
}

.custom-sticky-price {
    font-weight: bold;
    color: #27ae60;
    font-size: 13px;
}

/* Variations (button style) */
.custom-sticky-variations {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.custom-sticky-variations button {
    padding: 4px 8px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.custom-sticky-variations button:hover,
.custom-sticky-variations button.active {
    background: #27ae60;
    color: #fff;
    border-color: #27ae60;
}

/* Quantity */
.custom-sticky-qty {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.custom-sticky-qty label {
    font-weight: 500;
    color: #555;
}

.custom-sticky-qty-input {
    width: 40px!important;  /* ⬅ smaller width */
    padding: 8px 0px!important;
    text-align: center!important;
    border: 1px solid #ccc!important;
    border-radius: 4px!important;
    font-size: 12px!important;
}

/* Add to cart button */
.custom-sticky-actions .custom-sticky-button {
    padding: 8px 14px;
    background: #27ae60;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}

.custom-sticky-actions .custom-sticky-button:hover:enabled {
    background: #219150;
}

.custom-sticky-actions .custom-sticky-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================
   Mobile Responsive Grid
   ========================== */
@media (max-width: 600px) {
    .custom-sticky-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "product product"
            "variations variations"
            "qty action";
        gap: 6px;
        padding: 8px;
    }

    .custom-sticky-product {
        grid-area: product;
        justify-content: flex-start;
    }

    .custom-sticky-variations {
        grid-area: variations;
    }

    .custom-sticky-qty {
        grid-area: qty;
    }

    .custom-sticky-actions {
        grid-area: action;
        text-align: right;
    }

    .custom-sticky-actions .custom-sticky-button {
        width: 100%;
        padding: 10px;
    }
}

/* Floating toggle button */


#sticky-cart-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px;
    transition: all 0.3s ease;
}

/* Toggle button styles */
.sticky-toggle-bar {
    position: absolute;
    top: -20px;
/*    left: 50%;
    transform: translateX(-50%);*/
    z-index: 1000;
}

.sticky-toggle-bar button {
    width: 25px;
    height: 20px;
    border-radius: 6px 6px 0 0;
    background: var(--atc-sticky-bg); 
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    font-size: 25px;
    line-height: .6;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: all 0.3s ease;
    border: 0;
}


/* Collapsed state */
#sticky-cart-wrapper.collapsed {
    padding: 0;
}

#sticky-cart-wrapper.collapsed #sticky-cart-content {
    display: none;
}

/* Footer detection styles */
.custom-sticky-atc.hide-sticky {
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.custom-sticky-atc.visible {
    transform: translateY(0);
    transition: transform 0.3s ease-in-out;
}

/* Make sure footer has proper spacing */
footer {
    position: relative;
    z-index: 1;
}