/* --- Scroll & Base --- */
html,body {
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
}
body {
    font-family: Arial, sans-serif;
    background: #f0f2f5;
    margin: 0;
}
main {
    width: 100%;
}

/* --- Container --- */
.container {
    background: #fff;
    padding: 20px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
    margin: 0 auto 24px auto;
}

/* --- Floating Input Group --- */
.floating-input-group {
    position: relative;
    margin-bottom: 20px;
    padding: 0;
}
.floating-input-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 40px 14px 12px;
    border: 1px solid #007bff;
    border-radius: 6px;
    font-size: 16px;
    background: #fff;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    position: relative;
}
.floating-input-group input:focus {
    border: 1.5px solid #1976d2;
    box-shadow: 0 2px 8px rgba(0,123,255,0.10);
}
.floating-input-group label {
    position: absolute;
    left: 16px;
    top: 14px;
    color: #888;
    background: transparent;
    font-size: 16px;
    pointer-events: none;
    transition: top 0.2s, left 0.2s, font-size 0.2s, color 0.2s, background 0.2s, padding 0.2s;
}
.floating-input-group input:focus + label,
.floating-input-group input:not(:placeholder-shown) + label {
    top: -10px;
    left: 12px;
    font-size: 13px;
    color: #1976d2;
    background: #fff;
    padding: 0 4px;
    box-shadow: 0 2px 8px rgba(0,123,255,0.08);
}
.floating-input-group .question-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #f0f2f5;
    border: none;
    color: #007bff;
    font-size: 18px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    pointer-events: auto;
}

/* --- Popup Overlay & Popup --- */
.popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.25);
    display: none;
    z-index: 999;
}
.custom-popup {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 24px 18px;
    max-width: 340px;
    width: 90vw;
    text-align: center;
    z-index: 1000;
    display: none;
}
.popup-img {
    width: 100%;
    max-width: 1000px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.popup-text {
    font-size: 10px;
    color: #333;
    margin-bottom: 18px;
}
.popup-ok-btn {
    padding: 10px 24px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
}

/* --- Gift Grid Styles --- */
.gift-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px;
    margin-bottom: 0;
    margin-right: 2px;
    overflow-x: unset;
    width: 95%;
    min-width: 0;
    grid-auto-rows: 160px;
    height: 100%;
    max-width: 100%;
}
.gift-card {
    background-color: #fff;
    border: 1.5px solid #e0e3e7;
    border-radius: 12px;
    padding: 18px 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    flex: 1 1 0;
    height: 100%;
    box-sizing: border-box;
    max-width: 100%;
    min-height: 100%;
    max-height: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.gift-card.selected {
    border-color: #1976d2;
    box-shadow: 0 0 8px rgba(25, 118, 210, 0.15);
}
.gift-icon {
    font-size: 25px;
    margin-bottom: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.diamond-icon {
    width: 10px;
    height: 10px;
    margin-right: 5px;
}
.gift-points {
    color: #555;
    font-size: 12px;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.gift-price {
    font-weight:500;
    color: #333;
    font-size: 12px;
}

/* --- Coupon & Bottom Bar --- */
/* --- Coupon & Bottom Bar --- */
.coupon-section {
    padding: 0 15px;
    margin-bottom: 15px;
}
.coupon-input-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
}
.coupon-input-row input {
    flex: 1;
    font-size: 10px;
    padding: 12px 10px;
    margin-right: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.coupon-input-row button {
    background-color: #1976d2;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    padding: 10px 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,123,255,0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    height: 40px;
    display: flex;
    align-items: center;
}
.coupon-input-row button:hover {
    background-color: #0056b3;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.15);
}
.coupon-msg {
    font-size: 14px;
    margin-top: 6px;
}
.confirm-button {
    background-color: #1976d2;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    height: 30px;
}

/* --- Bottom Bar Adjusted --- */
.bottom-bar {
    background-color: #eee;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
    border-radius: 0 0 8px 8px;
    gap: 8px;
    flex-wrap: nowrap;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin: 0 auto 16px auto;
}
.quantity-selector {
    order: 1;
    flex: none;
    justify-content: flex-start;
    align-items: center;
    display: flex;
    min-width: 70px;
    margin-bottom: 0;
}
.total-info {
    order: 2;
    flex: none;
    justify-content: flex-end;
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 12px;
    text-align: right;
    margin-bottom: 0;
}
.confirm-button {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 24px auto;
    align-self: stretch;
    order: 3;
    display: block;
}

/* --- WhatsApp & Search --- */
.whatsapp-float {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px; /* Form ke niche gap ke liye */
  justify-content: center; /* Center me lane ke liye */
}

.whatsapp-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(37,211,102,0.15);
  transition: transform 0.3s;
  animation: whatsappPulse 1.2s infinite alternate;
}

.whatsapp-text {
  background-color: #02411a;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  align-self: center;
  display: flex;
  align-items: center;
  height: 38px;
  margin: 0 8px 0 0;
  box-shadow: 0 2px 8px rgba(37,211,102,0.10);
  animation: slideText 2.5s infinite alternate;
}

@keyframes slideText {
  0% {opacity: 0; transform: translateX(20px);}
  20% {opacity: 1; transform: translateX(0);}
  80% {opacity: 1; transform: translateX(0);}
  100% {opacity: 0; transform: translateX(-20px);}
}

@keyframes whatsappPulse {
  0% {transform: scale(1);}
  100% {transform: scale(1.12);}
}

.search-container {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    box-sizing: border-box;
    padding: 0 8px;
}
@media (max-width: 900px) {
    .container {
        max-width: 98vw;
        padding: 10px;
    }
    .gift-grid {
        grid-template-columns: repeat(3, 1fr); /* Always 3 columns */
    }
    .search-container {
        max-width: 100vw;
        padding: 4px;
    }
}
@media (max-width: 600px) {
    .bottom-bar {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 8px;
        padding: 10px 5px;
        max-width: 100vw;
        margin: 0 auto;
    }
    .quantity-selector {
        order: 1;
        flex: none;
        justify-content: flex-start;
        align-items: center;
        display: flex;
        min-width: 70px;
        margin-bottom: 0;
    }
    .total-info {
        order: 2;
        flex: none;
        justify-content: flex-end;
        align-items: center;
        display: flex;
        flex-direction: row;
        gap: 12px;
        text-align: right;
        margin-bottom: 0;
    }
    .confirm-button {
        width: 100%;
        max-width: 400px;
        margin: 0 auto 24px auto;
        align-self: stretch;
        order: 3;
        display: block;
    }
    .gift-grid {
        grid-template-columns: repeat(3, 1fr) !important; /* Always 3 columns */
        gap: 8px;
        overflow-x: unset;
        display: grid;
        width: 100%;
        grid-auto-rows: 100px;
    }
    .gift-card {
        min-width: unset;
        flex: 1 1 0;
        padding: 8px;
        height: 100%;
        box-sizing: border-box;
        max-width: 100%;
        min-height: 100%;
        max-height: 100%;
    }
    .search-container {
        max-width: 100vw;
        padding: 2px;
    }
}
@media (max-width: 400px) {
    .container {
        padding: 2px;
    }
    .gift-grid {
        grid-template-columns: repeat(3, 1fr) !important; /* Always 3 columns */
    }
    .gift-card {
        padding: 6px;
    }
    .popup-img {
        max-width: 140px;
    }
    .search-container {
        max-width: 100vw;
        padding: 1px;
    }
}