/**
 * Weight Selector Popup Styles - Updated with Price Display
 * Theme Color: #b87939
 */

/* ============================================
   POPUP OVERLAY & CONTAINER
============================================ */
.ws-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: overlayFade 0.4s ease;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ws-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

@keyframes overlayFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ws-popup-container {
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
    border-radius: 24px;
    max-width: 500px;
    width: 95%;
    overflow: hidden;
    box-shadow: 
        0 0 0 1px rgba(184, 121, 57, 0.1),
        0 50px 100px rgba(0, 0, 0, 0.5),
        0 20px 40px rgba(184, 121, 57, 0.2);
    animation: popupEntry 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    transform: scale(0.8) translateY(50px);
    opacity: 0;
}

.ws-popup-overlay.active .ws-popup-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

@keyframes popupEntry {
    from {
        transform: scale(0.8) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ============================================
   POPUP CLOSE BUTTON
============================================ */
.ws-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(184, 121, 57, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.ws-popup-close:hover {
    background: #b87939;
    border-color: #b87939;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(184, 121, 57, 0.3);
}

.ws-popup-close:active {
    transform: rotate(90deg) scale(0.95);
}

.ws-popup-close svg {
    width: 18px;
    height: 18px;
    color: #b87939;
    transition: color 0.3s ease;
    stroke-width: 2.5;
}

.ws-popup-close:hover svg {
    color: #fff;
}

/* ============================================
   POPUP HEADER
============================================ */
.ws-popup-header {
    position: relative;
    padding: 40px 24px 32px;
    background: 
        linear-gradient(135deg, rgba(184, 121, 57, 0.05) 0%, rgba(212, 148, 90, 0.05) 100%),
        #fff;
    text-align: center;
    border-bottom: 1px solid rgba(184, 121, 57, 0.1);
    overflow: hidden;
    display: flex;
    justify-content: start;
    align-items: start;
    gap: 5px;
}

.ws-popup-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent,
        #b87939 20%,
        #d4945a 50%,
        #b87939 80%,
        transparent
    );
    animation: headerShine 3s infinite;
}

@keyframes headerShine {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
/* popup header ke CSS ke baad add karo */
.product-detail {
    display: flex;
    flex-direction: column;
    width: 250px;
    justify-content: start;
    align-items: start;
}
.ws-popup-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    max-width: 90%;
    text-align: start;
}
 
.ws-popup-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    /*overflow: hidden;*/
    /*background: linear-gradient(135deg, #b87939, #d4945a);*/
    padding: 5px;
    /*box-shadow: */
    /*    0 0 0 6px rgba(184, 121, 57, 0.1),*/
    /*    0 10px 24px rgba(184, 121, 57, 0.3);*/
    transition: all 0.4s ease;
    position: relative;
    margin: 0 !important;
}

.ws-popup-image:hover {
    transform: scale(1.05);
}

.ws-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: #fff;
    box-shadow: none !important;
}

.ws-popup-title {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #b87939 0%, #d4945a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;
}

/* ============================================
   POPUP BODY - Weight Selector with Prices
============================================ */
.ws-popup-body {
    padding: 28px 24px;
    background: #fafafa;
    max-height: calc(90vh - 360px);
    overflow-y: auto;
}

.ws-popup-body::-webkit-scrollbar {
    width: 6px;
}

.ws-popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ws-popup-body::-webkit-scrollbar-thumb {
    background: #b87939;
    border-radius: 3px;
}

.ws-popup-body .weight-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ws-popup-body .weight-label::before {
    content: '';
    width: 3px;
    height: 14px;
    background: linear-gradient(to bottom, #b87939, #d4945a);
    border-radius: 2px;
}

/* Weight Buttons Grid with Prices */
.ws-popup-body .weight-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.ws-popup-body .weight-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.ws-popup-body .weight-btn:hover {
    background: linear-gradient(135deg, rgba(184, 121, 57, 0.05), rgba(212, 148, 90, 0.05));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 121, 57, 0.15);
    border-color: rgba(184, 121, 57, 0.3);
}

.ws-popup-body .weight-btn.active {
    background: linear-gradient(135deg, #b87939 0%, #d4945a 100%);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(184, 121, 57, 0.35),
        0 0 0 3px rgba(184, 121, 57, 0.1);
}

.ws-popup-body .weight-btn input[type="radio"] {
    display: none;
}

/* Weight Label in Button */
.ws-popup-body .weight-btn .weight-option-label {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    letter-spacing: -0.3px;
    transition: color 0.3s ease;
}

.ws-popup-body .weight-btn.active .weight-option-label {
    color: #fff;
}

/* Price Label in Button */
.ws-popup-body .weight-btn .weight-option-price {
    font-size: 13px;
    font-weight: 700;
    color: #b87939;
    background: rgba(184, 121, 57, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ws-popup-body .weight-btn.active .weight-option-price {
    color: #fff;
    background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   QUANTITY CONTROLS
============================================ */
.ws-popup-quantity-wrapper {
    margin-bottom: 24px;
}

.ws-popup-quantity-wrapper .quantity-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ws-popup-quantity-wrapper .quantity-label::before {
    content: '';
    width: 3px;
    height: 14px;
    background: linear-gradient(to bottom, #b87939, #d4945a);
    border-radius: 2px;
}

.ws-popup-quantity {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 6px 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.ws-popup-quantity .qty-btn {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #b87939 0%, #d4945a 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(184, 121, 57, 0.25);
}

.ws-popup-quantity .qty-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(184, 121, 57, 0.35);
}

.ws-popup-quantity .qty-btn:active {
    transform: scale(0.95);
}

.ws-popup-quantity .qty-input {
    width: 55px;
    height: 36px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 17px;
    font-weight: 700;
    color: #2d3748;
    margin-left: 5px ;
    margin-right: -5px ;
}

.ws-popup-quantity .qty-input:focus {
    outline: none;
}

/* ============================================
   TOTAL PRICE DISPLAY
============================================ */
.ws-popup-price {
    background: #fff;
    padding: 24px 18px;
    display: flex;
    text-align: center;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 3px 10px rgba(184, 121, 57, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}



@keyframes priceGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ws-popup-price-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.ws-popup-price-value {
    font-size: 20px;
    font-weight: 600;
    position: relative;
    z-index: 1;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    line-height: 1;
    
    /* Comprehensive font stack */
    font-family: 
        /* System serif fonts */
        ui-serif, 
        /* Apple devices */
        "Apple Garamond", "Baskerville",
        /* Common serif fonts */
        Georgia, Cambria, "Times New Roman", Times,
        /* Generic fallback */
        serif !important;
    
    /* Improve rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================
   POPUP FOOTER
============================================ */
.ws-popup-footer {
    padding: 24px;
    background: #fff;
}

.ws-popup-add-to-cart {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #b87939 0%, #d4945a 50%, #b87939 100%);
    background-size: 200% 100%;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 6px 20px rgba(184, 121, 57, 0.35),
        0 0 0 3px rgba(184, 121, 57, 0.1);
}

.ws-popup-add-to-cart::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.ws-popup-add-to-cart:hover::before {
    transform: translateX(100%);
}

.ws-popup-add-to-cart:hover {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 
        0 8px 28px rgba(184, 121, 57, 0.45),
        0 0 0 4px rgba(184, 121, 57, 0.15);
}

.ws-popup-add-to-cart:active {
    transform: translateY(0);
}

.ws-popup-add-to-cart svg,
.ws-popup-add-to-cart span {
    position: relative;
    z-index: 1;
}

.ws-popup-add-to-cart.loading {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

.ws-popup-add-to-cart .spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 768px) {
.ws-popup-quantity .qty-input {
    margin-left: 7px ;
    margin-right: -7px ;
}
    
    .ws-popup-header {
        padding: 32px 20px 24px;
    }
    
    .ws-popup-image {
        width: 100px;
        height: 100px;
    }
    
    .ws-popup-title {
        font-size: 19px;
    }
    
    .ws-popup-body {
        padding: 24px 20px;
    }
    
    .ws-popup-body .weight-btn {
        padding: 14px 10px;
    }
    
    .ws-popup-body .weight-btn .weight-option-label {
        font-size: 15px;
    }
    
    .ws-popup-body .weight-btn .weight-option-price {
        font-size: 12px;
    }

    
    .ws-dual-buttons .ws-quick-cart {
        padding: 8px !important;
    }
    
    .quick-add-icon {
        width: 20px !important;
        height: 20px !important;
    }
}

@media (max-width: 540px) {
    
     .ws-popup-description {
        font-size: 11px;
        margin-top: 8px;
    }
    .ws-popup-price-value {
    font-size: 16px;

}


    .ws-dual-buttons .ws-quick-cart {
        padding: 5px !important;
    }
    
    .ws-popup-header {
        padding: 12px;
    }
    
    .ws-popup-body {
        padding: 20px 16px;
    }
    
    .ws-popup-body .weight-buttons {
        gap: 10px;
    }
    
    .ws-popup-body .weight-btn {
        padding: 12px 8px;
    }
    
    .ws-popup-body .weight-btn .weight-option-label {
        font-size: 14px;
    }
    
    .ws-popup-body .weight-btn .weight-option-price {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    .ws-popup-quantity {
        gap: 8px;
        padding: 4px 8px;
    }
    
    .ws-popup-quantity .qty-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .ws-popup-quantity .qty-input {
        width: 50px;
        height: 32px;
        font-size: 15px;
    margin-left: 0 ;
    margin-right: 0 ;

    }

}

@media (max-width: 446px) {
    .ws-popup-description {
        font-size: 10px;
        margin-top: 8px;
    }

    .ws-popup-body .weight-label, 
    .ws-popup-quantity-wrapper .quantity-label {
        font-size: 11px;
        margin-bottom: 12px;
    }
    
    .ws-popup-body .weight-buttons {
        gap: 6px;
    }
    
    .ws-popup-body .weight-btn {
        padding: 10px 0;
    }
    
    .ws-popup-body .weight-btn .weight-option-label {
        font-size: 13px;
    }
    
    .ws-popup-body .weight-btn .weight-option-price {
        font-size: 10px;
        padding: 2px 8px;
    }
    
    .ws-popup-price-label {
        font-size: 9px;
    }

    
    .ws-popup-price {
        padding: 10px 14px;
    }
    
    .ws-popup-add-to-cart {
        font-size: 11px;
        padding: 10px 10px;
    }
    
    .ws-popup-footer {
        padding: 16px 16px;
    }
    
    .ws-popup-body {
        padding: 16px 12px;
    }
    
    .ws-popup-image {
        width: 80px;
        height: 80px;
    }
    
    .ws-popup-quantity .qty-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .ws-popup-quantity .qty-input {
        width: 45px;
        height: 28px;
        font-size: 14px;
    }
}

/* ============================================
   SUCCESS TOAST
============================================ */
.ws-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 1000000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.ws-toast.show {
    transform: translateX(0);
}

.ws-toast-success {
    border-left: 4px solid #4caf50;
}

.ws-toast-error {
    border-left: 4px solid #f44336;
}

.ws-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ws-toast-icon {
    font-size: 24px;
}

.ws-toast-message {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}