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

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    background:
        radial-gradient(circle at 0% 0%, #FEDA75 0%, rgba(254, 218, 117, 0) 35%),
        linear-gradient(135deg, #FA7E1E 0%, #D62976 38%, #962FBF 68%, #4F5BD5 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

header {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

header h1 {
    color: #667eea;
    font-size: 1.5em;
}

nav {
    display: flex;
    align-items: center;
}

nav a {
    margin-left: 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #667eea;
    padding: 5px 10px;
}

nav a:hover, nav a.active {
    color: #667eea;
}

main {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.store-header h2 {
    color: #667eea;
}

.cart-icon {
    position: fixed;
    top: 80px;
    right: 30px;
    background: #667eea;
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 100;
    font-size: 1.2em;
    transition: transform 0.3s;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.filters select, .filters input {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
    flex: 1;
}

.filters input {
    flex: 2;
}

.ad-slider-container {
    margin: 4px 0 18px;
}

.ad-slider-track-wrap {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #f6f7fb;
    min-height: 265px;
    height: 265px;
}

.ad-slider-track {
    width: 100%;
    height: 265px;
    position: relative;
}

.ad-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    pointer-events: none;
}

.ad-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.ad-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(0, 0, 0, 0.22);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-slider-nav:hover {
    background: rgba(0, 0, 0, 0.35);
}

.ad-slider-nav-prev {
    left: 10px;
}

.ad-slider-nav-next {
    right: 10px;
}

.ad-slider-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.ad-slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #c8ceda;
    cursor: pointer;
    padding: 0;
}

.ad-slider-dot.active {
    background: #667eea;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    max-height: none !important;
    overflow-y: visible !important;
    padding: 10px;
    border-radius: 5px;
    scroll-behavior: smooth;
}

.product-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
    background: #e0e0e0;
}

.product-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.product-card .category {
    color: #667eea;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.product-card .price {
    font-size: 1.5em;
    font-weight: bold;
    color: #764ba2;
    margin: 10px 0;
}

.product-card .stock {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.product-card button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
}

.product-card button:hover {
    background: #764ba2;
}

.product-card button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plus-btn {
    background: #28a745;
    color: white;
}

.plus-btn:hover:not(:disabled) {
    background: #218838;
    transform: scale(1.1);
}

.minus-btn {
    background: #dc3545;
    color: white;
}

.minus-btn:hover:not(:disabled) {
    background: #c82333;
    transform: scale(1.1);
}

.qty-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.qty-display {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
    min-width: 30px;
    text-align: center;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0,0,0,0.2);
    transition: right 0.3s;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    color: #667eea;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #666;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 10px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    margin-bottom: 5px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-controls button {
    background: #667eea;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
}

.cart-footer {
    padding: 20px;
    border-top: 2px solid #e0e0e0;
}

.cart-total {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #333;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.3s;
}

.checkout-btn:hover:not(:disabled) {
    background: #764ba2;
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.empty-cart {
    text-align: center;
    color: #999;
    padding: 40px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

/* Ensure edit and add modals are scrollable */
#edit-modal .modal-content,
#add-modal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
    margin: 3% auto;
}

/* Better spacing for smaller screens */
@media (max-height: 800px) {
    #edit-modal .modal-content,
    #add-modal .modal-content {
        max-height: 95vh;
        margin: 2% auto;
        padding: 20px;
    }
}

/* About Us Modal - Responsive sizing */
#about-us-modal .modal-content {
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    margin: 3% auto;
    padding: 25px;
}

@media (max-width: 768px) {
    #about-us-modal .modal-content {
        max-width: 95%;
        max-height: 90vh;
        margin: 2% auto;
        padding: 20px;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 2em;
    cursor: pointer;
    color: #666;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 80%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
}

.form-group input[type="radio"],
.form-group input[type="checkbox"] {
    width: auto;
    border: none;
    padding: 0;
}

.form-group textarea {
    resize: vertical;
    min-height: 50px;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #764ba2;
}

.loading {
    text-align: center;
    color: #999;
    padding: 40px;
}

.products-grid .loading {
    color: #fff;
    font-weight: 700;
}

/* Admin Styles */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 12px 30px;
    background: transparent;
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #667eea;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: transparent;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


.admin-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.admin-section:last-child {
    border-bottom: none;
}

.payment-settings {
    max-width: min(1200px, 100%);
}

.payment-settings .form-group {
    margin-bottom: 20px;
}

/* Store Details tab: two-column field grid on wider screens */
.store-details-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 28px;
    align-items: start;
}

.store-details-fields-grid .form-group {
    margin-bottom: 0;
}

.store-details-fields-grid .form-group--full {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .store-details-fields-grid {
        grid-template-columns: 1fr;
    }

    .store-details-fields-grid .form-group--full {
        grid-column: 1;
    }
}

/* Razorpay keys: side-by-side when both fields visible */
.razorpay-keys-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 24px;
    align-items: start;
}

.razorpay-keys-grid .form-group {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .razorpay-keys-grid {
        grid-template-columns: 1fr;
    }
}

/* Store Details tab: pair major panels side-by-side on large screens */
.store-details-panels-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
    margin-top: 32px;
}

/* Left: Operating Schedule + WhatsApp; right: Payment + Store Status */
.store-details-left-stack,
.store-details-right-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.store-details-panels-row > .store-details-left-stack > .operating-schedule-section,
.store-details-panels-row > .store-details-left-stack > .whatsapp-notifications-section,
.store-details-panels-row > .store-details-right-stack > .payment-settings-section,
.store-details-panels-row > .store-details-right-stack > .go-live-section {
    margin-top: 0;
}

@media (max-width: 992px) {
    .store-details-panels-row {
        grid-template-columns: 1fr;
    }

    .store-details-panels-row > .store-details-left-stack > .operating-schedule-section,
    .store-details-panels-row > .store-details-left-stack > .whatsapp-notifications-section,
    .store-details-panels-row > .store-details-right-stack > .payment-settings-section,
    .store-details-panels-row > .store-details-right-stack > .go-live-section {
        margin-top: 0;
    }
}

.payment-settings small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

.upload-box {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 2px dashed #667eea;
}

.upload-box ul {
    margin: 15px 0;
    padding-left: 25px;
}

.upload-box li {
    margin: 8px 0;
}

.download-sample-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.download-sample-btn:hover {
    background: #5568d3;
}

.upload-btn, .refresh-btn, .export-btn {
    padding: 12px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.3s;
}

.upload-btn:hover, .refresh-btn:hover, .export-btn:hover {
    background: #764ba2;
}

.ads-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.ads-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.ads-image-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
}

.ads-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ads-image-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 13px;
    line-height: 18px;
    cursor: pointer;
    padding: 0;
}

.add-btn {
    padding: 12px 25px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
}

.add-btn:hover {
    background: #218838;
}

.delete-selected-btn {
    padding: 12px 25px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
}

.delete-selected-btn:hover:not(:disabled) {
    background: #c82333;
}

.delete-selected-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.go-live-btn {
    padding: 12px 30px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.go-live-btn:hover:not(:disabled) {
    background: #218838;
    transform: scale(1.05);
}

.go-live-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.copy-link-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.copy-link-btn:hover {
    background: #764ba2;
}

.go-live-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #667eea;
}

.go-live-section h3 {
    margin-top: 0;
    color: #667eea;
}

.go-live-section p {
    color: #666;
    margin-bottom: 15px;
}

.public-link-container {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.public-link-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.public-link-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    background: #f8f9fa;
}

.public-link-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.copy-status {
    margin-top: 10px;
    font-size: 0.9em;
}

.go-live-tip {
    margin-top: 15px;
    color: #666;
    font-size: 0.9em;
}

.store-qr-block {
    margin-top: 8px;
}

.store-qr-block-inner {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 2px solid #e0e0e0;
}

.store-qr-block-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.store-qr-block-hint {
    margin: 0 0 14px 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.45;
}

.store-qr-block-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.store-qr-block-actions .copy-link-btn {
    margin: 0;
}

.store-qr-image {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.store-qr-image img,
.store-qr-image canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.store-qr-placeholder {
    color: #888;
    font-size: 0.9em;
    text-align: center;
    padding: 0.75rem;
}

.store-qr-tagline {
    margin: 12px 0 6px 0;
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
    text-align: center;
}

.store-qr-url-line {
    margin: 0;
    color: #667eea;
    font-size: 0.88em;
    word-break: break-all;
    text-align: center;
    line-height: 1.4;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #28a745;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 1px #28a745;
}

/* Maintenance Message Styles */
.maintenance-message {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 40px auto;
    max-width: 600px;
}

.maintenance-message h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2em;
}

.maintenance-message p {
    color: #666;
    font-size: 1.1em;
}

/* Image Navigation Button Styles */
.image-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.image-nav-btn:hover {
    background: rgba(102, 126, 234, 0.9) !important;
    color: white !important;
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

.image-nav-btn:active {
    transform: translateY(-50%) scale(0.95) !important;
}

/* Image Indicators Styles */
.image-indicators {
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.image-dot {
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.image-dot:hover {
    transform: scale(1.3);
    border-color: #667eea;
}

.image-dot.active {
    border-color: #667eea;
    box-shadow: 0 0 4px rgba(102, 126, 234, 0.6);
}

.clear-filters-btn {
    padding: 12px 25px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
}

.clear-filters-btn:hover {
    background: #5a6268;
}

#upload-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
}

#upload-status.success {
    background: #d4edda;
    color: #155724;
}

#upload-status.error {
    background: #f8d7da;
    color: #721c24;
}

.inventory-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.inventory-controls input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
}

.inventory-table-container {
    overflow-x: auto;
    max-height: calc(100vh - 200px);
    min-height: 500px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    scroll-behavior: smooth;
    position: relative;
}

/* Better height calculation for smaller screens */
@media (max-height: 800px) {
    .inventory-table-container {
        max-height: calc(100vh - 180px);
        min-height: 500px;
    }
}

@media (max-height: 600px) {
    .inventory-table-container {
        max-height: calc(100vh - 160px);
        min-height: 500px;
    }
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.inventory-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.inventory-table th {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: left;
    position: relative;
}

.inventory-table th:first-child {
    width: 50px;
    text-align: center;
}

.inventory-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.inventory-table th.sortable:hover {
    background: #5568d3;
}

.sort-indicator {
    font-size: 0.8em;
    margin-left: 5px;
}

.filter-row {
    background: #f0f0f0;
}

.filter-row th {
    background: #f0f0f0;
    padding: 8px;
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 50px;
    z-index: 9;
}

.filter-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    box-sizing: border-box;
}

.filter-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.inventory-table td:first-child {
    text-align: center;
}

.inventory-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.inventory-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.inventory-table tr:hover {
    background: #f8f9fa;
}

.action-btn {
    padding: 6px 12px;
    margin: 0 3px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.edit-btn {
    background: #667eea;
    color: white;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.orders-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

/* Highlight orders still in pending workflow status; clears when status is updated */
.order-card.order-card--pending {
    background: #e8f5e9;
    border-left-color: #2e7d32;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.order-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

.order-status.pending {
    background: #fff3cd;
    color: #856404;
}

.order-status.out_for_delivery {
    background: #cfe2ff;
    color: #084298;
}

.order-status.order_delivered {
    background: #d4edda;
    color: #155724;
}

.order-items {
    margin: 15px 0;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.order-total {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
    margin-top: 10px;
}

/* ==================== MOBILE RESPONSIVE STYLES ==================== */

@media (max-width: 768px) {
    /* Container and spacing */
    .container {
        padding: 10px;
    }
    
    main {
        padding: 15px;
        border-radius: 5px;
        margin-bottom: 15px;
    }
    
    /* Header - Mobile hamburger menu */
    header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        position: relative;
    }
    
    header h1 {
        font-size: 1.2em;
    }
    
    /* Mobile menu toggle button */
    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.5em;
        cursor: pointer;
        color: #667eea;
        padding: 5px 10px;
    }
    
    /* Navigation - Stack vertically on mobile */
    nav {
        display: flex;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        padding: 0;
        z-index: 100;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    nav.mobile-open {
        max-height: 400px;
        padding: 15px;
    }
    
    nav a {
        margin-left: 0;
        padding: 12px 15px;
        border-bottom: 1px solid #e0e0e0;
        display: block;
        width: 100%;
    }
    
    nav a:last-child {
        border-bottom: none;
    }
    
    nav a:hover {
        background: #f8f9fa;
    }
    
    /* Store header */
    .store-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .store-header h2 {
        font-size: 1.3em;
        margin: 0;
    }
    
    /* Cart icon - Better positioning for mobile */
    .cart-icon {
        position: fixed;
        bottom: 20px;
        right: 20px;
        top: auto;
        padding: 15px 20px;
        font-size: 1.1em;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        z-index: 999;
        border-radius: 50px;
    }
    
    .cart-icon:hover {
        transform: scale(1.05);
    }
    
    /* Filters - Stack vertically */
    .filters {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .filters select,
    .filters input {
        width: 100%;
        padding: 12px 15px;
        font-size: 1em;
    }
    
    /* Products grid - Two columns on narrow screens */
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        max-height: none;
        padding: 5px;
    }

    .ad-slider-track {
        height: 212px;
    }

    .ad-slider-track-wrap {
        min-height: 212px;
        height: 212px;
    }
    
    /* Product cards - Compact for two-column mobile layout */
    .product-card {
        padding: 10px;
        min-width: 0;
    }
    
    .product-card img {
        height: 120px;
    }
    
    .product-card h3 {
        font-size: 0.95em;
        word-break: break-word;
    }
    
    .product-card .price {
        font-size: 1.05em;
    }
    
    /* Quantity controls - Larger touch targets */
    .quantity-controls {
        gap: 20px;
        margin-top: 15px;
    }
    
    .qty-btn {
        width: 45px;
        height: 45px;
        font-size: 1.5em;
    }
    
    .qty-display {
        font-size: 1.4em;
        min-width: 40px;
    }
    
    /* Cart sidebar - Full width on mobile */
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-sidebar.open {
        right: 0;
    }
    
    .cart-header {
        padding: 15px;
    }
    
    .cart-header h2 {
        font-size: 1.2em;
    }
    
    .cart-items {
        padding: 15px;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }
    
    .cart-item-info {
        width: 100%;
    }
    
    .cart-item-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .cart-item-controls button {
        width: 35px;
        height: 35px;
        font-size: 1.1em;
    }
    
    .cart-footer {
        padding: 15px;
    }
    
    .cart-total {
        font-size: 1.3em;
        margin-bottom: 12px;
    }
    
    .checkout-btn {
        padding: 15px;
        font-size: 1.1em;
    }
    
    /* Modals - Full screen on mobile */
    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 20px;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
        overflow-y: auto;
    }
    
    .close {
        right: 15px;
        top: 10px;
        font-size: 2.5em;
        padding: 5px;
    }
    
    /* Form elements - Better mobile input */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        border: 2px solid #e0e0e0;
    }
    
    .form-group textarea {
        min-height: 100px;
    }
    
    .submit-btn {
        padding: 15px;
        font-size: 1.1em;
        margin-top: 10px;
    }
    
    /* Payment method selection - Better mobile layout */
    .form-group label[style*="flex"] {
        padding: 15px !important;
        font-size: 1em;
    }
    
    /* Touch-friendly buttons */
    button, .qty-btn, .cart-icon {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
        touch-action: manipulation;
    }
    
    /* Image navigation - Better mobile controls */
    .image-nav-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2em !important;
    }
    
    /* Announcements - Better mobile display */
    #announcements-container {
        font-size: 0.9em;
        padding: 10px 0;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.1em;
    }
    
    .store-header h2 {
        font-size: 1.1em;
    }
    
    .product-card {
        padding: 8px;
    }
    
    .product-card img {
        height: 110px;
    }
    
    .product-card h3 {
        font-size: 0.9em;
    }
    
    .product-card .price {
        font-size: 1em;
    }
    
    .cart-icon {
        bottom: 15px;
        right: 15px;
        padding: 12px 18px;
        font-size: 1em;
    }
    
    .qty-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3em;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .close {
        font-size: 2em;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cart-icon {
        bottom: 15px;
        right: 15px;
    }
    
    .modal-content {
        max-height: 95vh;
        margin: 2% auto;
        border-radius: 10px;
    }
}

.product-image-date {
    margin: 6px 0 4px;
    color: #59636e;
    font-size: 12px;
    line-height: 1.4;
}

.product-image-date:empty {
    display: none;
}
.whatsapp-config { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.whatsapp-config input:not([type="checkbox"]), .whatsapp-config select { box-sizing: border-box; width: 100%; min-width: 0; padding: 8px; border: 1px solid #b7bec5; border-radius: 4px; font-size: 14px; }
.whatsapp-clear-token { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.whatsapp-template-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.whatsapp-template-row { padding: 12px 0; border-top: 1px solid #d6dce1; }
.whatsapp-template-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 8px; align-items: end; }
.whatsapp-template-row label { display: grid; gap: 4px; font-size: 13px; min-width: 0; }
.whatsapp-template-row details { margin-top: 8px; font-size: 13px; }
.whatsapp-template-row summary { cursor: pointer; padding: 4px 0; }
.whatsapp-parameter { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 32px; align-items: center; gap: 6px; margin-top: 6px; }
.whatsapp-config button[aria-label] { width: 32px; height: 32px; padding: 0; flex-shrink: 0; font-size: 20px; border: 1px solid #aab4be; background: #fff; color: #263746; border-radius: 4px; cursor: pointer; }
#whatsapp-token-status, #whatsapp-config-message { font-size: 13px; overflow-wrap: anywhere; }
.whatsapp-setup-guide { margin: 0 0 16px; padding: 10px 12px; border: 1px solid #d6dce1; border-radius: 4px; background: #fff; color: #263746; font-size: 13px; }
.whatsapp-setup-guide summary { cursor: pointer; font-weight: 600; }
.whatsapp-setup-guide ol { margin: 10px 0; padding-left: 20px; display: grid; gap: 6px; }
.whatsapp-callback-url { margin: 8px 0 0; overflow-wrap: anywhere; }
.whatsapp-connection-status { margin: 8px 0 0; font-size: 13px; }
#whatsapp-save-settings { min-height: 40px; padding: 10px 14px; margin-top: 8px; border: 0; border-radius: 4px; background: #246b4e; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.whatsapp-config button:disabled { cursor: default; opacity: .5; }
@media (max-width: 480px) { .whatsapp-template-main { grid-template-columns: minmax(0, 1fr) 32px; } .whatsapp-template-main label:first-child { grid-column: 1 / -1; } }
#product-dialog { box-sizing: border-box; width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 48px 24px 24px; border: 1px solid #d8dce0; border-radius: 8px; background: #fff; color: #263238; overflow-y: auto; }
#product-dialog::backdrop { background: rgba(0, 0, 0, .6); }
#product-dialog-close { position: absolute; top: 8px; right: 10px; width: 32px; height: 32px; border: 0; background: #edf1f3; color: #263238; font-size: 24px; border-radius: 4px; cursor: pointer; }
.product-dialog-gallery { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #f3f5f6; }
.product-dialog-image { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-dialog-image[hidden] { display: none; }
.product-dialog-image-controls { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 4px; background: #fff; border-radius: 4px; }
.product-dialog-image-controls button { width: 32px; height: 32px; font-size: 24px; border: 1px solid #c7cfd3; border-radius: 4px; background: white; cursor: pointer; }
.product-dialog-image-count { min-width: 40px; text-align: center; font-size: 13px; }
.product-dialog-details { overflow-wrap: anywhere; }
.product-dialog-details h3 { font-size: 24px; line-height: 1.3; margin: 12px 0 8px; padding-right: 70px; }
.product-dialog-details .price { font-size: 22px; margin: 12px 0; font-weight: 600; }
.product-dialog-details .quantity-controls { margin-top: 16px; }
.product-dialog-checkout { width: 100%; min-height: 44px; margin-top: 12px; padding: 10px; border: 0; border-radius: 4px; background: #246b4e; color: white; font-size: 16px; font-weight: 600; cursor: pointer; }
.product-dialog-checkout:disabled { background: #d6dce0; color: #59636e; cursor: default; }
.product-card[aria-haspopup="dialog"] { cursor: pointer; }
.product-card[aria-haspopup="dialog"]:focus-visible { outline: 3px solid #246b4e; outline-offset: 3px; }
@media (max-width: 480px) { #product-dialog { padding: 46px 16px 20px; } .product-dialog-details h3 { font-size: 20px; } }

/* Customer storefront refresh ------------------------------------------------ */
/* Scoped visual overrides keep the admin screens and shop behaviour intact. */
body {
    --ink: #17261f;
    --muted: #637269;
    --line: #e3e9e3;
    --canvas: #f6f8f4;
    --surface: #ffffff;
    --leaf: #1f6b4f;
    --leaf-dark: #164b38;
    --lime: #d8f06a;
    --sun: #f7bd52;
    background: radial-gradient(circle at 100% -10%, #e4f2bf 0, transparent 27rem), #f6f8f4;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

body > header {
    position: sticky;
    top: 0;
    z-index: 200;
    margin: 0;
    background: rgba(246, 248, 244, .9);
    border: 0;
    border-bottom: 1px solid rgba(23, 38, 31, .08);
    box-shadow: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body > header .container,
main.container {
    width: min(1240px, calc(100% - 32px));
    max-width: none;
    margin-inline: auto;
    padding-inline: 0;
    border: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body > header .container {
    min-height: 70px;
    padding-block: 12px;
}

header h1 {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 800;
    letter-spacing: -.035em;
}

header h1::first-letter { color: var(--leaf); }

nav { gap: 6px; }
nav a {
    margin: 0;
    padding: 9px 12px;
    border-radius: 999px;
    color: #405249;
    font-size: .9rem;
}
nav a:hover, nav a.active { color: var(--leaf-dark); background: #e6f0db; }

main.container {
    background: transparent;
    padding-block: 28px 56px;
    box-shadow: none;
    border-radius: 0;
    margin-bottom: 0;
}

.store-header {
    position: relative;
    min-height: 128px;
    align-items: flex-end;
    margin-bottom: 22px;
    padding: clamp(20px, 3vw, 30px) clamp(24px, 4vw, 40px);
    overflow: hidden;
    border-radius: 28px;
    background: linear-gradient(118deg, #173d2f 0%, #1f6b4f 57%, #407e5c 100%);
    box-shadow: 0 18px 35px rgba(22, 75, 56, .18);
    color: white;
}
.store-header::after {
    position: absolute;
    right: -50px;
    bottom: -100px;
    width: 230px;
    height: 230px;
    content: "";
    border: 42px solid rgba(216, 240, 106, .14);
    border-radius: 50%;
}
.store-header > div:first-child { position: relative; z-index: 1; max-width: 700px; }
.store-kicker {
    margin: 0 0 5px;
    color: var(--lime);
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.store-header h2 {
    color: #fff;
    font-size: clamp(1.4rem, 3vw, 2.05rem);
    font-weight: 800;
    letter-spacing: -.055em;
    line-height: 1.06;
}
.store-subtitle { margin: 7px 0 0; color: rgba(255,255,255,.76); font-size: clamp(.86rem, 1.4vw, .98rem); }
#announcements-container {
    margin-top: 11px !important;
    padding: 7px 10px !important;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px !important;
    background: rgba(10, 41, 29, .24) !important;
}
#announcements-text { color: #fff5c8 !important; font-size: .88rem; }
textarea#announcements-text { color: #000 !important; }

.cart-icon {
    position: fixed;
    right: max(22px, calc((100vw - 1240px) / 2));
    top: auto;
    bottom: 24px;
    z-index: 190;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 54px;
    padding: 13px 17px;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    box-shadow: 0 14px 28px rgba(23, 38, 31, .25);
    font-size: 1.05rem;
    font-weight: 800;
}
.cart-icon::before { content: "Cart"; font-size: .82rem; font-weight: 700; }
.cart-icon:hover { transform: translateY(-3px); background: var(--leaf-dark); }
#cart-count {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: var(--lime);
    color: var(--ink);
    font-size: .72rem;
}

.filters {
    display: grid;
    grid-template-columns: minmax(185px, .7fr) minmax(0, 1.6fr);
    gap: 10px;
    margin-bottom: 25px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 8px 22px rgba(32, 67, 45, .05);
}
.filters select, .filters input {
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 11px;
    outline: none;
    background: #f4f7f1;
    color: var(--ink);
    font: inherit;
}
.filters select { cursor: pointer; font-weight: 650; }
.filters input { background: #fff; }
.filters select:focus, .filters input:focus { border-color: #9dc7a1; box-shadow: 0 0 0 3px rgba(31,107,79,.11); }

.ad-slider-container { margin: 0 0 28px; }
.ad-slider-track-wrap { min-height: min(30vw, 350px); height: min(30vw, 350px); border-radius: 22px; background: #e8eee3; box-shadow: 0 12px 25px rgba(32,67,45,.09); }
.ad-slider-track { height: 100%; }
.ad-slider-nav { width: 42px; height: 42px; border: 0; background: rgba(255,255,255,.88); color: var(--ink); box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.ad-slider-nav:hover { background: #fff; }
.ad-slider-dot { width: 7px; height: 7px; background: #c8d2c8; }
.ad-slider-dot.active { width: 22px; border-radius: 10px; background: var(--leaf); }

.products-grid {
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    gap: 18px;
    padding: 0;
    border-radius: 0;
}
.products-grid .loading { grid-column: 1 / -1; color: var(--muted); font-weight: 600; }
.product-card {
    display: flex;
    min-width: 0;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    padding: 0 16px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 2px 3px rgba(23,38,31,.02);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.product-card:hover {
    transform: translateY(-5px);
    border-color: #bdd7be;
    box-shadow: 0 15px 30px rgba(30,69,47,.13);
}
.product-card > img,
.product-image-container {
    width: calc(100% + 32px) !important;
    height: 205px !important;
    margin: 0 -16px 14px !important;
    border-radius: 17px 17px 0 0 !important;
    background: #edf2e9;
}
.product-card > img { object-fit: cover !important; }
.product-image-container img { height: 205px !important; object-fit: cover !important; }
.product-image-date { min-height: 18px; margin: -5px 0 4px; color: #849087; font-size: .72rem; }
.product-card h3 { margin: 3px 0 4px; color: var(--ink); font-size: 1.03rem; font-weight: 750; letter-spacing: -.018em; line-height: 1.25; }
.product-card .category {
    width: fit-content;
    margin: 0 0 8px;
    padding: 4px 8px;
    border-radius: 99px;
    background: #edf5e9;
    color: var(--leaf-dark);
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.product-card .price { margin: 12px 0 5px; color: var(--ink); font-size: 1.18rem; font-weight: 800; letter-spacing: -.025em; }
.product-card .price span[style*="667eea"] { color: var(--muted) !important; font-size: .76rem; font-weight: 700 !important; }
.product-card .price span[style*="28a745"] { color: var(--leaf) !important; }
.product-card p[style] { color: var(--muted) !important; line-height: 1.45; }
.product-card [style*="background: #ff6b6b"] { top: 12px !important; right: 12px !important; border-radius: 999px !important; background: #e85d3f !important; box-shadow: 0 3px 10px rgba(147,48,27,.25); }
.product-card [style*="color: #28a745"] { color: var(--leaf) !important; }

.quantity-controls { margin-top: auto; gap: 9px; padding-top: 15px; justify-content: space-between; }
.qty-btn {
    flex: 0 0 39px;
    width: 39px;
    height: 39px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #f2f6ef;
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 600;
}
.plus-btn, .minus-btn { background: #f2f6ef; color: var(--leaf-dark); }
.plus-btn:hover:not(:disabled), .minus-btn:hover:not(:disabled) { background: var(--leaf); color: #fff; transform: none; }
.qty-btn:disabled { background: #f4f5f3; color: #a4aea4; }
.qty-display { flex: 1; min-width: 0; color: var(--ink); font-size: .9rem; font-weight: 800; }
.product-card > button[disabled] { margin-top: auto; border-radius: 11px; }

.cart-sidebar { width: min(420px, 100vw); right: min(-420px, -100vw); background: #fbfcf9; box-shadow: -20px 0 45px rgba(13,39,26,.2); }
.cart-sidebar.open { right: 0; }
.cart-header { padding: 25px 24px 18px; border-bottom: 1px solid var(--line); }
.cart-header h2 { color: var(--ink); font-size: 1.28rem; letter-spacing: -.03em; }
.close-btn, .close { color: var(--ink); }
.cart-items { padding: 16px; }
.cart-item { padding: 14px 8px; border-bottom-color: var(--line); }
.cart-item-controls button { border-radius: 9px; background: var(--leaf); }
.cart-footer { padding: 18px 20px 22px; border-top: 1px solid var(--line); background: #fff; }
.checkout-btn, .submit-btn, .product-dialog-checkout { border-radius: 12px; background: var(--leaf); box-shadow: none; font-weight: 750; }
.checkout-btn:hover:not(:disabled), .submit-btn:hover, .product-dialog-checkout:hover { background: var(--leaf-dark); }

.modal { background: rgba(13, 29, 20, .55); backdrop-filter: blur(5px); }
.modal-content, #product-dialog { border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 55px rgba(11,36,23,.28); }
.form-group input, .form-group textarea { width: 100%; border: 1px solid #d7dfd5; border-radius: 10px; }

#product-dialog { width: min(640px, calc(100% - 28px)); padding: 52px 24px 24px; border-color: var(--line); color: var(--ink); }
#product-dialog-close { border-radius: 10px; background: #eef3eb; color: var(--ink); }
.product-dialog-gallery { border-radius: 14px; overflow: hidden; background: #edf2e9; }
.product-dialog-image-controls { border-radius: 10px; box-shadow: 0 3px 11px rgba(0,0,0,.15); }
.product-dialog-checkout { min-height: 48px; }

@media (max-width: 768px) {
    body > header .container, main.container { width: min(100% - 24px, 1240px); }
    body > header .container { min-height: 62px; }
    .mobile-menu-toggle { color: var(--leaf-dark); }
    nav { border: 1px solid var(--line); border-radius: 0 0 15px 15px; background: #fff; box-shadow: 0 12px 24px rgba(23,38,31,.12); }
    nav.mobile-open { padding: 8px; }
    nav a { border: 0; border-radius: 9px; }
    .store-header { min-height: 148px; align-items: flex-start; padding: 21px 20px; border-radius: 21px; }
    .store-header::after { right: -105px; bottom: -85px; width: 205px; height: 205px; }
    .store-subtitle { max-width: 290px; }
    .filters { grid-template-columns: 1fr; padding: 7px; border-radius: 14px; }
    .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
    .product-card { padding: 0 11px 12px; border-radius: 14px; }
    .product-card > img, .product-image-container { width: calc(100% + 22px) !important; height: 145px !important; margin: 0 -11px 11px !important; border-radius: 13px 13px 0 0 !important; }
    .product-image-container img { height: 145px !important; }
    .product-card h3 { font-size: .91rem; }
    .product-card .price { margin-top: 9px; font-size: 1rem; }
    .product-card .category { margin-bottom: 6px; padding: 3px 6px; font-size: .61rem; }
    .product-card p[style] { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .78rem !important; }
    .quantity-controls { gap: 6px; padding-top: 11px; }
    .qty-btn { flex-basis: 34px; width: 34px; height: 34px; border-radius: 9px; font-size: 1.15rem; }
    .qty-display { font-size: .74rem; white-space: nowrap; }
    .cart-icon { right: 16px; bottom: 16px; padding: 12px 15px; }
    .cart-sidebar { width: 100%; right: -100%; }
    .ad-slider-track-wrap { min-height: 190px; height: 190px; border-radius: 16px; }
    .ad-slider-nav { width: 34px; height: 34px; }
}

@media (max-width: 370px) {
    .products-grid { grid-template-columns: 1fr; }
    .product-card > img, .product-image-container, .product-image-container img { height: 185px !important; }
}

/* Unified customer storefront header. */
#main-header { background: linear-gradient(118deg, #173d2f 0%, #1f6b4f 57%, #407e5c 100%); color: white; }
#main-header .container { display: flex; flex-wrap: wrap; gap: 12px 20px; padding-block: 20px; background: transparent; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
#main-header .store-heading { flex: 1; min-width: 0; }
#main-header #store-name-header { margin: 0; color: white; overflow-wrap: anywhere; }
#main-header #store-welcome { margin: 8px 0 0; color: white; font-size: 1.1rem; line-height: 1.4; }
#main-header .store-contact-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#main-header #contact-us-link { display: inline-flex; align-items: center; min-height: 44px; color: white; white-space: nowrap; }
#main-header #announcements-container { flex-basis: 100%; min-width: 0; margin-top: 0 !important; padding: 0 !important; background: transparent !important; border: 0; border-radius: 0 !important; box-shadow: none; }
#main-header nav a { align-items: center; min-height: 44px; }
#main-header #contact-us-link { font-size: .9rem; }
#main-header a:focus-visible, #main-header button:focus-visible { outline: 3px solid #ffdc35; outline-offset: 3px; }
#main-header .mobile-menu-toggle { color: white; }
@media (min-width: 769px) { #main-header nav a { color: white; } }
@media (max-width: 768px) {
  #main-header .store-heading { flex-basis: calc(100% - 64px); }
  #main-header .store-contact-actions { flex-basis: 100%; justify-content: flex-end; }
  #main-header nav a { color: var(--ink, #25251f); }
}
