/* Tirzok One-Page eCommerce Styles */

/* Import Bengali Font */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@300;400;500;600;700&display=swap');

/* CSS Variables for PureBD Theme */
:root {
    --purebd-primary: #2d7a5f;
    --purebd-primary-dark: #1a4d3a;
    --purebd-secondary: #4a9b7e;
    --purebd-light: #e8f5e8;
    --purebd-text: #333;
    --purebd-text-light: #666;
    --purebd-success: #28a745;
    --purebd-warning: #ffc107;
    --purebd-danger: #dc3545;
    --purebd-border: #e9ecef;
}

/* Base Styles - Scoped to onepage module */
.onepage-container body,
.onepage-container {
    font-family: 'Noto Sans Bengali', Arial, sans-serif;
    color: var(--purebd-text);
    line-height: 1.6;
}

/* Typography - Scoped to onepage module */
.onepage-container h1, 
.onepage-container h2, 
.onepage-container h3, 
.onepage-container h4, 
.onepage-container h5, 
.onepage-container h6 {
    font-family: 'Noto Sans Bengali', Arial, sans-serif;
    font-weight: 600;
}

.section-title {
    color: var(--purebd-primary-dark);
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--purebd-primary);
    border-radius: 2px;
}

/* Hero Section */
.hero-gradient {
    background: linear-gradient(135deg, var(--purebd-primary) 0%, var(--purebd-primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-gradient .container {
    position: relative;
    z-index: 2;
}

/* Buttons */
.btn-purebd {
    background-color: var(--purebd-primary);
    border-color: var(--purebd-primary);
    color: white;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-purebd:hover {
    background-color: var(--purebd-primary-dark);
    border-color: var(--purebd-primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(45, 122, 95, 0.4);
}

.btn-purebd:focus {
    box-shadow: 0 0 0 0.2rem rgba(45, 122, 95, 0.25);
}

/* Utility Classes */
.text-purebd {
    color: var(--purebd-primary) !important;
}

.bg-purebd {
    background-color: var(--purebd-primary) !important;
}

.bg-purebd-light {
    background-color: var(--purebd-light) !important;
}

.border-purebd {
    border-color: var(--purebd-primary) !important;
}

/* Cards - Scoped to onepage module */
.onepage-container .card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.onepage-container .card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(45, 122, 95, 0.2), 0 10px 10px -5px rgba(45, 122, 95, 0.1);
}

.onepage-container .product-card .card-img-top {
    transition: transform 0.3s ease;
}

.onepage-container .product-card:hover .card-img-top {
    transform: scale(1.05);
}

/* Benefits Section */
.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.benefits-list li {
    background: var(--purebd-light);
    margin-bottom: 15px;
    padding: 15px 20px;
    border-left: 4px solid var(--purebd-primary);
    border-radius: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.benefits-list li:hover {
    background: white;
    box-shadow: 0 5px 15px rgba(45, 122, 95, 0.1);
    transform: translateX(5px);
}

.benefits-list li:before {
    content: "✓";
    color: var(--purebd-primary);
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 15px;
    display: inline-block;
    width: 20px;
    text-align: center;
}

/* Trust Section */
.trust-item {
    background: white;
    padding: 30px 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    margin-bottom: 20px;
    border-top: 4px solid var(--purebd-primary);
    transition: all 0.3s ease;
    height: 100%;
}

.trust-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(45, 122, 95, 0.2);
}

.trust-item i {
    margin-bottom: 20px;
    color: var(--purebd-primary);
}

.trust-item p {
    margin: 0;
    font-weight: 500;
    color: var(--purebd-text);
}

/* Order Form */
.order-form {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid var(--purebd-border);
}

.onepage-container .form-control {
    border: 2px solid var(--purebd-border);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.onepage-container .form-control:focus {
    border-color: var(--purebd-primary);
    box-shadow: 0 0 0 0.2rem rgba(45, 122, 95, 0.25);
}

.onepage-container .form-label {
    font-weight: 600;
    color: var(--purebd-text);
    margin-bottom: 8px;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.qty-btn {
    background: var(--purebd-primary);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--purebd-primary-dark);
    transform: scale(1.1);
}

.qty-input {
    width: 70px;
    text-align: center;
    border: 2px solid var(--purebd-border);
    border-radius: 8px;
    padding: 8px;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Order Table */
.order-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.order-table th,
.order-table td {
    padding: 15px 10px;
    border-bottom: 1px solid var(--purebd-border);
    text-align: left;
}

.order-table th {
    background: var(--purebd-light);
    font-weight: 600;
    color: var(--purebd-primary-dark);
}

.total-row {
    font-weight: bold;
    border-top: 3px solid var(--purebd-primary);
    background: var(--purebd-light);
}

.total-row td {
    color: var(--purebd-primary-dark);
    font-size: 1.1rem;
}

/* Contact Section */
.phone-link {
    color: var(--purebd-primary);
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.phone-link:hover {
    color: var(--purebd-primary-dark);
    text-decoration: none;
    transform: scale(1.05);
}

/* Reviews Section */
.star-rating {
    color: #fbbf24;
    font-size: 1.1rem;
}

.star-rating i {
    margin-right: 2px;
}

/* Cart Modal */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: var(--purebd-light);
    border-bottom: 2px solid var(--purebd-primary);
    border-radius: 15px 15px 0 0;
}

.modal-title {
    color: var(--purebd-primary-dark);
    font-weight: 600;
}

/* Fixed Cart Button */
.position-fixed button {
    box-shadow: 0 8px 25px rgba(45, 122, 95, 0.3);
    transition: all 0.3s ease;
}

.position-fixed button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(45, 122, 95, 0.4);
}

/* Category Filter Buttons */
.category-filter {
    margin: 5px;
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-filter.active,
.category-filter:hover {
    background-color: var(--purebd-primary) !important;
    border-color: var(--purebd-primary) !important;
    color: white !important;
    transform: translateY(-2px);
}

/* Stock Status Badges - Scoped to onepage module */
.onepage-container .badge {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-gradient {
        padding: 40px 0;
    }
    
    .hero-gradient h1 {
        font-size: 2rem;
    }
    
    .hero-gradient .lead {
        font-size: 1rem;
    }
    
    .order-form {
        padding: 20px;
        margin: 0 10px;
    }
    
    .trust-item {
        margin-bottom: 15px;
    }
    
    .benefits-list li {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .phone-link {
        font-size: 1.4rem;
    }
    
    .quantity-controls {
        flex-direction: column;
        gap: 5px;
    }
    
    .qty-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 576px) {
    .hero-gradient h1 {
        font-size: 1.5rem;
    }
    
    .order-form {
        padding: 15px;
    }
    
    .trust-item {
        padding: 20px 15px;
    }
    
    .benefits-list li {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

/* ---- Mobile ---- */
/* Never let anything widen the page sideways on a phone */
.onepage-container {
    overflow-x: clip;
}

/* Long store names: one line, cut with "…" (full name on hover / in the hero) */
.onepage-brand {
    max-width: calc(100% - 64px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Notifications stay inside the screen */
.onepage-container ~ .alert.position-fixed,
body > .alert.position-fixed {
    max-width: calc(100vw - 2rem);
}

/* Bottom order bar (phones) */
.onepage-mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1010;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.onepage-mobile-bar .btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
}

@media (min-width: 768px) {
    .onepage-mobile-bar {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    body.onepage-bar-on .onepage-container {
        padding-bottom: 80px;
    }

    body.onepage-bar-on .onepage-cart-float {
        bottom: 76px !important;
    }

    /* Bigger touch targets in the order summary */
    .checkout-qty-btn,
    .checkout-remove-btn {
        min-width: 40px;
        min-height: 40px;
        font-size: 1.1rem;
    }

    /* 16px inputs: iPhone does not zoom in while typing */
    #checkout-form .form-control,
    #checkout-form .form-select {
        font-size: 16px;
        min-height: 48px;
    }

    .hero-gradient .btn-lg {
        width: 100%;
        max-width: 320px;
    }
}

/* Print Styles - Scoped to onepage module */
@media print {
    .onepage-container .hero-gradient,
    .onepage-container .position-fixed,
    .onepage-container .modal,
    .onepage-container .btn {
        display: none !important;
    }
    
    .onepage-container .container {
        max-width: none !important;
    }
    
    .onepage-container .card {
        break-inside: avoid;
    }
}

/* High Contrast Mode - Scoped to onepage module */
@media (prefers-contrast: high) {
    .onepage-container {
        --purebd-primary: #1a4d3a;
        --purebd-primary-dark: #0f2e20;
        --purebd-text: #000;
        --purebd-border: #333;
    }
    
    .onepage-container .card {
        border: 2px solid var(--purebd-border);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

