/* =========================
   WhatsApp Order Plugin - Cleaned CSS
   ========================= */

/* Layout - product grid */
.wop-products-container {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.wop-columns-3 { grid-template-columns: repeat(3, 1fr); }
.wop-columns-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 768px) {
    .wop-columns-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .wop-columns-3, .wop-columns-2 { grid-template-columns: 1fr; }
}

/* Product card */
.wop-product {
    border: 1px solid #ddd;
    padding: 22px; /* tightened spacing for premium feel */
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wop-product:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Product Title (base) */
.wop-product h3 {
    margin: 6px 0 8px;
    font-size: 1.2rem;     /* ~25.6px */
    color: #333;
    min-height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Product size */
.wop-product-size {
    font-size: 0.98rem; /* ~15.7px */
    color: #666;
    margin: 6px 0 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

/* =========================
   Product image container (responsive)
   - Desktop: aspect-ratio box (shorter)
   - Mobile: full width with natural image height + taller min-height
   ========================= */

.wop-product-image-container {
    position: relative;
    width: 100%;
    margin: 10px auto;
    overflow: hidden;
    border-radius: 5px;
    background: #f9f9f9;
    box-sizing: border-box;
}

/* Desktop: aspect ratio box (keeps grid consistent) */
@media (min-width: 992px) {
    .wop-product-image-container {
        max-width: 640px;  /* wider on desktop */
    }
    .wop-product-image-container::before {
        content: "";
        display: block;
        padding-top: 140%;  /* aspect ratio (height relative to width) */
    }
    .wop-product-image-container img.wop-product-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;         /* no crop, show whole product */
        object-position: center center;
        display: block;
    }
}

/* Mobile and tablet: allow image to determine height (full width, no gaps) */
/* Also ensure mobile has a taller minimum height so product is prominent */
@media (max-width: 991px) {
    .wop-product-image-container::before { display: none; }

    .wop-product-image-container {
        min-height: 500px;   /* user's desired taller mobile container */
        padding: 6px;
        display: block;
    }

    .wop-product-image-container img.wop-product-image {
        position: relative;
        width: 100%;
        height: auto;
        object-fit: contain;
        object-position: center top;
        display: block;
    }
}

/* Legacy small breakpoint adjustments (kept for robustness) */
@media (max-width: 768px) {
    .wop-product h3 {
        font-size: 16px;
        min-height: 22px;
    }
    .wop-product-size { font-size: 13px; }
}

/* =========================
   Pricing
   ========================= */
.wop-product-pricing { margin: 10px 0; }

.wop-price-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.wop-mrp-price {
    text-decoration: line-through;
    color: #999;
    font-size: 16px;
    font-weight: 600;
    opacity: 0.95;
    text-decoration-thickness: 2px;
    margin-right: 8px;
}

.wop-selling-price {
    color: #25D366;
    font-size: 1.3rem; /* ~20.8px */
    font-weight: 800;
    position: relative;
    letter-spacing: 0.8px;
}

.wop-selling-price:after {
    content: "";
    display: block;
    margin: 6px auto 0;
    width: 40%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #25D366, transparent);
    opacity: 0.9;
}

.wop-selling-price-only,
.wop-mrp-price-only {
    color: #25D366;
    font-size: 1.3rem;
    font-weight: 800;
}

/* =========================
   Button
   ========================= */
.wop-product-button { margin-top: auto; padding-top: 15px; }

.wop-order-btn {
    background: #25D366;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
}
.wop-order-btn:hover { background: #128C7E; transform: translateY(-2px); }
.wop-order-btn img { width: 20px; height: 20px; margin: 0; }

/* =========================
   Modal styles
   ========================= */
.wop-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    overflow: hidden;
}
.wop-modal-content {
    background-color: #fefefe;
    margin: 3% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: translateY(-50px);
    animation: slideDown 0.3s ease forwards;
    position: relative;
    border: 2px solid #25D366;
    display: flex;
    flex-direction: column;
}
@keyframes slideDown { to { transform: translateY(0); } }
.wop-close {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 8px;
    transition: color 0.3s ease;
    z-index: 10001;
    background: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-size: 20px;
}
.wop-close:hover { color: #000; background: #f0f0f0; }
.wop-modal-content h3 {
    margin: 0;
    padding: 15px 25px;
    background: linear-gradient(45deg, #25D366, #128C7E);
    color: white;
    text-align: center;
    border-radius: 10px 10px 0 0;
    font-size: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 600;
}

/* Modal form */
#wop-order-form {
    padding: 0 25px 20px 25px;
    overflow-y: auto;
    max-height: calc(85vh - 100px);
    flex: 1;
}
#wop-order-form::-webkit-scrollbar { width: 5px; }
#wop-order-form::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 8px; }
#wop-order-form::-webkit-scrollbar-thumb { background: #25D366; border-radius: 8px; }
#wop-order-form::-webkit-scrollbar-thumb:hover { background: #128C7E; }

/* Form fields */
.form-field { margin: 10px 0; padding: 3px 0; }
.form-field label { display: block; margin-bottom: 4px; font-weight: 600; color: #333; font-size: 13px; }
.wop-field {
    width: 100%; padding: 10px; margin: 3px 0;
    border: 2px solid #ddd; border-radius: 6px;
    transition: all 0.3s ease; box-sizing: border-box; font-size: 13px; background: white; line-height: 1.3;
}
.wop-field:focus { border-color: #25D366; box-shadow: 0 0 8px rgba(37,211,102,0.3); transform: translateY(-1px); outline: none; }
.wop-field.error { border-color: #ff4444; box-shadow: 0 0 8px rgba(255,68,68,0.3); }
.wop-field[readonly] { background-color: #f5f5f5; color:#666; cursor:not-allowed; font-size:12px; }

.radio-group { display:flex; gap:12px; margin-top:3px; }
.radio-group label { display:flex; align-items:center; gap:4px; font-weight:normal; cursor:pointer; font-size:13px; margin-bottom:0; }
.radio-group input[type="radio"] { margin:0; transform:scale(0.9); }

/* Submit button */
.wop-submit-btn {
    background: linear-gradient(45deg,#25D366,#128C7E);
    color:white; border:none; padding:12px 25px; border-radius:6px; cursor:pointer; width:100%;
    font-size:14px; font-weight:600; margin-top:15px; transition:all 0.3s ease; box-shadow:0 4px 12px rgba(37,211,102,0.3);
    text-transform:uppercase; letter-spacing:0.5px; position:sticky; bottom:0; z-index:5;
}
.wop-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 15px rgba(37,211,102,0.4); background: linear-gradient(45deg,#128C7E,#25D366); }

.wop-loading, .wop-error { text-align:center; padding:15px; font-size:14px; }
.wop-loading { color:#25D366; }
.wop-error { color:#ff4444; }
.error-message { color:#ff4444; font-size:11px; display:block; margin-top:3px; font-weight:normal; }
.radio-group.error { border:1px solid #ff4444; padding:8px; border-radius:4px; background:#fff8f8; }

/* =========================
   Lightbox (no caption)
   ========================= */
.wop-lightbox-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: none;
    z-index: 11000; align-items:center; justify-content:center; padding:20px; animation: wopFadeIn .15s ease;
}
.wop-lightbox-overlay.open { display:flex; }
.wop-lightbox-content { max-width:1100px; max-height:90vh; width:100%; display:flex; align-items:center; justify-content:center; position:relative; }
.wop-lightbox-img { max-width:100%; max-height:90vh; object-fit:contain; border-radius:8px; box-shadow:0 10px 30px rgba(0,0,0,0.6); background:#fff; }
.wop-lightbox-close { position:absolute; top:12px; right:12px; background:rgba(255,255,255,0.95); border-radius:999px; width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; font-size:18px; color:#333; box-shadow:0 2px 8px rgba(0,0,0,0.3); line-height:1; }
@keyframes wopFadeIn { from { opacity:0; transform:scale(0.995); } to { opacity:1; transform:scale(1); } }
.wop-lightbox-trigger { cursor: zoom-in; display:inline-block; }

/* =========================
   Mobile typography tweaks (bigger & bolder title, size and prices)
   ========================= */
@media (max-width: 480px) {
    .wop-product h3 {
        font-size: 1.25rem !important;  /* ~20px */
        font-weight: 800 !important;
        line-height: 1.15;
        color: #222;
    }
    .wop-product-size {
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        margin-bottom: 8px;
    }
    .wop-mrp-price {
        font-weight: 700 !important;
        color: #999 !important;
        font-size: 15px;
    }
    .wop-selling-price,
    .wop-selling-price-only {
        font-weight: 900 !important;
        font-size: 1.15rem !important;
        color: #25D366 !important;
    }
    .wop-price-container { gap: 8px; }
}

/* Small tablets & larger phones */
@media (min-width: 481px) and (max-width: 991px) {
    .wop-product h3 { font-size: 1.45rem; font-weight: 800; line-height: 1.12; }
    .wop-product-size { font-size: 17px; font-weight: 700; }
    .wop-mrp-price { font-weight: 700; font-size: 15px; }
    .wop-selling-price, .wop-selling-price-only { font-weight: 800; font-size: 1.25rem; }
    .wop-price-container { gap: 10px; }
}

/* =========================
   Classy typography (Google fonts)
   ========================= */
/* Load fonts (only once) */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=Montserrat:wght@300;400;600;700;800&display=swap');

:root {
    --wop-title-font: "Playfair Display", Georgia, "Times New Roman", serif;
    --wop-ui-font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
    --wop-accent: #25D366;
    --wop-text: #111;
    --wop-muted: #666;
}

.wop-product h3 {
    font-family: var(--wop-title-font);
    font-weight: 700;
    letter-spacing: 0.6px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.03);
}

.wop-product-size {
    font-family: var(--wop-ui-font);
    font-weight: 600;
}

.wop-mrp-price {
    font-family: var(--wop-ui-font);
    font-weight: 600;
}

.wop-selling-price,
.wop-selling-price-only {
    font-family: var(--wop-title-font);
    font-weight: 800;
}

/* Out of stock button - red default, black on hover */
.wop-oof-btn {
    background: #c62828;       /* rich red */
    color: #ffffff;            /* white text */
    border: 1px solid #a21f1f; /* slightly darker border */
    padding: 12px 24px;
    border-radius: 5px;
    cursor: not-allowed;
    font-weight: 700;
    width: 100%;
    transition: background-color 180ms ease, color 180ms ease;
    box-shadow: none;
}

.wop-oof-btn:hover,
.wop-oof-btn:focus {
    background: #000000;       /* black on hover */
    color: #ffffff;
}


/* End of stylesheet */
