* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: 'Nunito', sans-serif;
    color: #4a4a4a;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    max-width: 100vw;
    width: 100vw;
}

button, .header-phone-link, a, label {outline: none;     -webkit-tap-highlight-color: rgba(0, 0, 0, 0);    
}

.background-gradient {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #fff5f8 0%, #f8e8ff 50%, #e8f5ff 100%);
    opacity: 0.6;
    z-index: -2;
    animation: gentleMove 40s ease infinite;
    margin-left: -10px;
    margin-right: -10px;
    margin-top: -10px;
    margin-bottom: -10px;
}

@keyframes gentleMove {
    0% { transform: translate(0, 0); }
    50% { transform: translate(10px, 10px); }
    100% { transform: translate(0, 0); }
}

/* Header with SVG waves */
.header-flex {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    z-index: 2;
}

.header-svg-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.85;
}

.header-flex::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    z-index: 1;
}

.header-logo {
    width: 160px;
    height: auto;
    border-radius: 10px;
    margin-right: 30px;
    box-shadow: 0 4px 12px rgba(212, 116, 159, 0.2);
    align-self: center;
    position: relative;
    z-index: 2;
}

.header-text {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
    align-self: center;
    
}

.subtitle {
    font-size: 1.4rem;
    font-weight: 600;
    color: #5e35b1;
    margin-bottom: 8px;
    line-height: 1.0
}

.shipping {
    font-size: 1.1rem;
    color: #c57ad3;/*#b86b9c;*/
    font-weight: 600;
    line-height: 1.1
}

/* Main */
#products-container {
    padding: 20px;
    max-width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
}

.product-card {
    display: flex;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(212, 116, 159, 0.15);
    max-width: 70vw;
    margin: 60px auto;
    opacity: 0;
    transition: transform 1.6s cubic-bezier(0.34, 0.68, 0.25, 1), 
                box-shadow 0.4s ease-in-out, 
                opacity 0.8s;
    width: calc(70vw + 12vw); /* Compensate for offset */
}

.product-card.visible {
    opacity: 1;
}

/* Base off-screen position (same as your old odd/even) */
.product-card {
    opacity: 0; /* Start hidden for smooth fade-in */
    transition: all 1.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateX(80px) scale(0.95);
}

/* Even cards come from left */
.product-card:nth-child(even) {
    transform: translateX(-80px) scale(0.95);
}

/* When in view → animate to center + full size */
.product-card.in-view {
    opacity: 1;
    transform: translateX(0) scale(1);
    box-shadow: 0 20px 40px rgba(212, 116, 159, 0.25);
}

/* Keep your margins if needed for layout */
.product-card:nth-child(odd) {
    margin-right: -80px;
    margin-left: auto;
}
.product-card:nth-child(even) {
    margin-left: -80px;
    margin-right: auto;
}

.product-image {
    flex: 1;
    min-width: 300px;
    cursor: pointer;
    overflow: hidden;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);    
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-image:hover img {
    transform: scale(1.05);
}

.product-info {
    flex: 2;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #b86b9c;
    margin-bottom: 15px;
    line-height: 1;
}

.product-info p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #666;
}

.price {
    font-size: 2rem;
    font-weight: 700;
    color: #d4749f;
    margin-bottom: 30px;
}

.old-price {
    font-size: 1.4rem;
    text-decoration: line-through;
    color: #aaa;
    margin-left: 15px;
}

.order-btn {
    align-self: flex-start;
    background: linear-gradient(45deg, #ff9ac4, #d4749f);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.order-btn:hover {
    background: linear-gradient(45deg, #ff80b5, #c45a8a);
    transform: translateY(-3px);
}

.order-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(212, 116, 159, 0.3);
    position: relative;
    transition: height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    /*max-height: calc(90vh - 60px); /* Prevents modal from growing too tall on mobile */
/*overflow-y: auto;*/
}

.modal-content h2 {
    margin-top:-4px;
    margin-bottom: 12px;
    line-height: 1;
    max-width: calc(100% - 36px);
}

#policy-modal .modal-content h2 {max-width: unset;}

.close, .gallery-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);    
}

#order-modal .close {
    color: #666;
}

.gallery-close {
    color: #fff;
}

/* Policy modal buttons - equal width + gradient */
#policy-accept, #policy-reject {
    flex: 1;                    /* equal width */
    max-width: 200px;           /* reasonable max */
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#policy-accept {
    background: linear-gradient(45deg, #ff9ac4, #d4749f);
}

#policy-reject {
    background: linear-gradient(45deg, #bbb, #999);
}

#policy-accept:hover {
    background: linear-gradient(45deg, #ff80b5, #c45a8a);
    transform: translateY(-3px);
}

#policy-reject:hover {
    background: linear-gradient(45deg, #aaa, #888);
    transform: translateY(-3px);
}

/* Error states */
.shake {
    animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
    border-color: red !important;
    outline: 1px solid red !important;
}
#email.shake {
     border-color: #ffeb3b !important;
    outline: 1px solid #ffeb3b !important;
    
}


#policy-text {font-size:0.9rem;}

#policy-text p, #policy-text li {
    margin-bottom: 6px;
    text-align: justify;
}

.shake-yellow {
/*    animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
    border-color: #ffeb3b !important;
    outline: 1px solid #ffeb3b !important;*/
}
.privacy-error {
    animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
/*    color: red;
    font-size: 0.85rem;*/
}

#order-status {
    position: relative;
}

.error-popup {
    position: absolute;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(45deg, #ff4d4d, #cc0000);
    color: white;
    border: 1px solid #cc0000;
    border-radius: 10px;
    padding: 15px;
    font-size: 1rem;
    text-align: center;
    opacity: 0;
    transform: translateY(0);
    transition: transform 0.35s ease-out, opacity 0.35s ease-out;
    pointer-events: none;
    z-index: 10;
    /* Allow natural height based on content */
    min-height: 54px; /* matches single-line input height */
    display: flex;
    align-items: center;
    justify-content: center;
}


#order-form input,
#order-form textarea, #order-status input {
    width: 100%;
    padding: 15px;
    margin: 12px 0 0 0;
    border: 1px solid #edd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
}

#order-form textarea {
    height: 80px;
    resize: vertical;
    vertical-align: top;
}

#order-form input:focus,
#order-form textarea:focus,
#order-form input:focus-visible,
#order-form textarea:focus-visible {
    outline: 1px solid #d4749f;
    border-color: #d4749f;
}

/* Also style the dynamically added code input */
#code-input:focus,
#code-input:focus-visible {
    outline: 1px solid #d4749f;
    border-color: #d4749f;
}

#order-form button, #order-status button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(45deg, #ff9ac4, #d4749f);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    margin-top: 20px;
}

#order-status p.firstp {margin-top: 20px;}
#order-status input {text-align: center;}


/* Spinner */
.spinner {
    width: 60px;
    height: 60px;
    animation: spin 1.2s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Gallery */
.gallery-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
}

#gallery-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    transition: transform 0.3s ease;
    touch-action: pan-x pan-y pinch-zoom;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    border: none;
    width: 60px;
    height: 100px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 101;
}

.prev-btn { left: 20px; }
.next-btn { right: 20px; }

.nav-btn svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.loading {
    text-align: center;
    font-size: 1.5rem;
    color: #d4749f;
    padding: 100px;
}

/* Shake animation for wrong code */
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error {
    animation: shake 0.5s;
    border-color: red !important;
}

div#selected-product > h3 {
    line-height: 1;
    margin-top: 8px;
    margin-bottom: 8px;
}

div#selected-product .selprice {
    margin-bottom: 8px;
    margin-top: 10px;
}

/* Media queries for product card max-width */
@media (min-width: 1920px) {
    .product-card {
        max-width: 62.5vw;
        width: calc(62.5vw + 12vw);
    }
}

@media (min-width: 1600px) and (max-width: 1919px) {
    .product-card {
        max-width: 75vw;
        width: calc(75vw + 12vw);
    }
}

@media (min-width: 1440px) and (max-width: 1599px) {
    .product-card {
        max-width: 80vw;
        width: calc(80vw + 12vw);
    }
}

@media (min-width: 1200px) and (max-width: 1439px) {
    .product-card {
        max-width: 95vw;
        width: calc(95vw + 12vw);
    }
}

@media (min-width: 1024px) and (max-width: 1199px) {
    .product-card {
        max-width: 100vw;
        width: calc(100vw + 12vw);
    }
}


/* style.css updates - Add these to the existing file */

/* Header Rearrangements */
.header-flex {
    justify-content: space-between; /* Logo left, text center, contact right */
    align-items: flex-start; /* Align to top for phone */
    padding: 20px;
}

.header-text {
    text-align: left; /* Better for 3 lines */
}

.subtitle {
    font-size: 1.4rem; /* Slightly smaller for fit */
    font-weight: 700;
    color: #5e35b1;
    margin-bottom: 4px;
}

.gift-line {
    font-size: 1.2rem;
    font-weight: 600;
    color: #d4749f; /* Accent color for gift promo */
    margin-bottom: 4px;
}

.shipping {
    font-size: 1.2rem;
    color: #c57ad3;
    margin-bottom: 0;
}

.header-contact {
    text-align: right;
    font-size: 1.0rem;
    color: #4a4a4a;
    z-index: 1; 
    position: absolute;
    display: block;
    top: 20px;
    right: 20px;
}

.header-phone-link, .header-phone {
    font-weight: 700;
    color: #5e35b1; /* Match subtitle color */
    margin-bottom: 12px;
    text-decoration: none;
}

footer .header-phone {
    color: #666;
    font-weight: 100;
}

.header-phone-link:hover, .header-phone-link:focus, .header-phone-link:visited, .header-phone-link:active {text-decoration: none; color: #5e35b1;}

.header-dynamic {
    font-size: 0.5rem; /* Same as phone */
    margin-bottom: 0;
    margin-top: -10px;
}

/* Footer Styles */
.footer-flex {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.7); /* Same as header before pseudo */
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.3);
    z-index: 2;
    margin-top: 40px;
}

.footer-flex::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.3);
    z-index: 1;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    position: relative;
    z-index: 2;
}

.footer-business, .footer-contacts {
    flex: 1;
    font-size: 0.95rem;
    color: #666;
}

.footer-business p, .footer-contacts p {
    margin-bottom: 8px;
}

.footer-contacts h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 100;
}

.footer-business a {
    color: #d4749f;
    text-decoration: underline;
}
.footer-contacts a, .footer-contacts a:visited {
    color: #666;
    text-decoration: underline;
    transition: 0.5s ease-out;
}

.footer-business a:hover, .footer-contacts a:hover, .footer-business a:visited, .footer-business a:focus, .footer-contacts a:focus {
    color: #d4749f;
    text-decoration: underline;
    transition: 0.5s ease-out;
}

.footer-trademark {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #aaa;
    text-align: center;
    position: relative;
    z-index: 2;
}


/* Mobile */
@media (max-width: 900px) {
    
    .header-dynamic {display: none;}
    
#policy-text {font-size:0.6rem;}
    .modal-content {padding: 30px;}  
    
    
    .header-logo {
        width: 120px;
        margin-right: 20px;
    }

    .subtitle {
        font-size: 1.0rem;
    }

    .shipping {
        font-size: 0.9rem;
        color: #b86b9c;
    }

    .product-card {
        flex-direction: column;
        max-width: 90vw;
        width: calc(90vw + 30px);
    }
    
    html { overflow:auto;} {body:overflow-x:hidden;}    
    
    main {
    margin: 0 auto;
    overflow-x: hidden;

}
    #products-container {
    max-width: calc(100vw + 60px);
    width: calc(100vw + 60px);        
    margin-left: -30px;
    margin-right: -30px;
    }

    .product-card {
        opacity: 0;
        transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
        transform: translateX(30px);
        margin: 20px 0;
        -webkit-transform: translateZ(0);     /* Forces hardware acceleration */
            transform: translateZ(0);
            -webkit-backface-visibility: hidden;  /* Extra stability on iOS */
            backface-visibility: hidden;  
        will-change: transform;
    }

    .product-card:nth-child(even) {
        transform: translateX(-30px);
    }

    /* Keep your original margins for layout */
    .product-card:nth-child(odd) {
        margin-right: 0;
    }
    .product-card:nth-child(even) {
        margin-left: 0;
    }

    .product-info h3 {
        font-size: 1.6rem;
    }

    .product-info p {
        font-size: 0.95rem;
    }

    .price {
        font-size: 1.8rem;
    }

    .product-image {
        aspect-ratio: 1 / 1;
    }

    /* Gallery nav buttons bottom */
    .nav-btn {
        top: auto;
        bottom: 20px;
        width: 60px;
        height: 60px;
    }
    
    .header-flex {
        flex-wrap: wrap; /* Allow wrapping if needed, but fits within height */
        justify-content: space-between;
    }

    .header-text {
        max-width: 100%;
        order: 3; /* Move text below logo/phone if wrap, but with small fonts it fits */
    }

    .header-contact {
        font-size: 0.9rem;
        line-height: 1.0;
        width: 100%;
        position: static;
        top: auto;
        right: auto;
        

    }
    
    .header-phone {color:#666;}
    .header-phone-link, .header-phone-link:hover, .header-phone-link:focus, .header-phone-link:visited, .header-phone-link:active {text-decoration: none; color: #666;}

    .subtitle {
        font-size: 1.0rem;
        line-height: 1.0;
    }

    .gift-line {
        font-size: 0.85rem;
        line-height: 1.0;
    }

    .shipping {
        font-size: 0.85rem;
    }

    /* Footer Mobile */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-business {
        margin-bottom: 20px;
    }    
    
#policy-modal .modal-content h2 {text-align: left!important; line-height: 1.1;}
    
}

@media (max-width:380px)
{
    #privacy-innerdiv {display: inline-grid;}
}

.header-flex, .footer-flex {
    opacity: 0;
    transition: opacity 0.7s ease;
}
.header-flex.loaded, .footer-flex.loaded {
    opacity: 1;
}


.back-to-home {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 200; /* higher than modals (100) and gallery buttons (101) */

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border-radius: 10px;
    padding: 12px 24px;

    box-shadow: 0 8px 25px rgba(212, 116, 159, 0.25);

    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #5e35b1;

    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.back-to-home:hover {
    background: rgba(255, 255, 255, 0.55);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(212, 116, 159, 0.35);
}

.back-to-home:active {
    transform: translateY(0);
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .back-to-home {
        bottom: 20px;
        right: 20px;
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}   

@media (max-width:372px) {
    .modal-content h2 {font-size:1.4em;}
}

@media (max-width:356px) {
    .modal-content h2 {font-size:1.2em;}
    .modal-content h3 {font-size:1.05em;} 
    #order-form button, #order-status button {font-size:1.05rem;}
}

html.is-windows {scrollbar-width:none;}

.is-windows #policy-text {overflow-y:auto; padding-right: 10px!important;}
 
.is-windows #policy-text::-webkit-scrollbar {
          width:10px;
          background:rgba(0,0,0,0.005);
        }
.is-windows #policy-text::-webkit-scrollbar-track {
          background:none;
        }
.is-windows #policy-text::-webkit-scrollbar-thumb {
        background:#fff5f8;
        border-radius: 3px;
}
.is-windows #policy-text::-webkit-scrollbar-thumb:hover {
        background:#ffc5c8;
}