/* ================================================================
   product-extras.css
   Product Detail Page ke liye extra features:
   1) Sticky mobile "Buy Now" button
   2) Delivery progress widget (order -> confirm -> deliver timeline)
   ================================================================ */

/* ===== 1) Sticky Buy Now button — mobile/responsive only ===== */
.sticky-buy-now-wrap {
    display: none; /* JS turns this on only after checking screen width */
    position: fixed;
    left: 0;
    right: 0;
    bottom: 78px; /* sits above the WhatsApp floating icon — adjust this value to match your icon's height/offset */
    z-index: 998;
    padding: 0 20px; /* keeps the button clear of the screen edges on both sides */
    pointer-events: none; /* wrapper itself doesn't block taps; button re-enables it */
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.sticky-buy-now-wrap.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.sticky-buy-now-btn {
    width: 100%;
    max-width: 245px; /* narrower pill so the WhatsApp icon stays visible on both sides */
    margin: 0 auto;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 26px rgba(108, 92, 231, 0.4);
    cursor: pointer;
}
.sticky-buy-now-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    animation: none !important;
}
.sticky-buy-now-btn:active {
    transform: scale(0.95) !important;
    animation-play-state: paused;
}
/* subtle "notice me" wiggle — small left-right / up-down / slight rotate, not a full spin */
.sticky-buy-now-btn.attract {
    animation: stickyAttract 2.6s ease-in-out infinite;
}
@keyframes stickyAttract {
    0%   { transform: translate(0, 0) rotate(0deg); }
    4%   { transform: translate(-3px, 0) rotate(-3deg); }
    8%   { transform: translate(3px, -2px) rotate(3deg); }
    12%  { transform: translate(-2px, 1px) rotate(-2deg); }
    16%  { transform: translate(2px, -1px) rotate(2deg); }
    20%  { transform: translate(0, -3px) rotate(0deg); }
    24%  { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}
/* Never show on tablets/desktops — mobile responsive view only */
@media (min-width: 769px) {
    .sticky-buy-now-wrap {
        display: none !important;
    }
}

/* ===== 2) Delivery Progress Widget — order-confirm-deliver timeline ===== */
.dpw-wrap {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    padding: 18px 16px 16px;
    margin: 18px 0;
    box-shadow: 0 6px 24px rgba(0,0,0,0.05);
}
.dpw-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dpw-title i { color: #6c5ce7; }

.dpw-steps {
    display: flex;
    align-items: flex-start;
}
.dpw-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    width: 86px;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    animation: dpwPopIn 0.45s ease forwards;
}
.dpw-step[data-step="2"] { animation-delay: 0.15s; }
.dpw-step[data-step="3"] { animation-delay: 0.30s; }
@keyframes dpwPopIn {
    to { opacity: 1; transform: translateY(0); }
}

.dpw-icon {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f0ff;
    color: #6c5ce7;
    font-size: 16px;
    border: 2px solid #e4e1ff;
    z-index: 1;
}
.dpw-step.is-current .dpw-icon {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(108,92,231,0.35);
}
.dpw-pulse {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(108,92,231,0.35);
    animation: dpwPulse 1.8s ease-out infinite;
}
@keyframes dpwPulse {
    0%   { transform: scale(1);   opacity: 0.55; }
    100% { transform: scale(1.9); opacity: 0; }
}

.dpw-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-top: 8px;
}
.dpw-date {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.dpw-line {
    flex: 1 1 auto;
    height: 3px;
    background: #eee;
    margin-top: 22px;
    border-radius: 3px;
    overflow: hidden;
    min-width: 20px;
}
.dpw-line-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
    border-radius: 3px;
    transition: width 1s ease;
}
/* only first segment fills — customer hasn't ordered yet, this is an estimate */
.dpw-wrap.dpw-in-view .dpw-line-fill[data-fill="1"] { width: 100%; }

@media (max-width: 480px) {
    .dpw-title { font-size: 12.5px; }
    .dpw-step { width: 66px; }
    .dpw-icon { width: 36px; height: 36px; font-size: 13px; }
    .dpw-pulse { width: 36px; height: 36px; }
    .dpw-label { font-size: 10.5px; }
    .dpw-date { font-size: 10px; }
    .dpw-line { margin-top: 18px; }
}