:root {
    --primary-color: #0A4F3B;
    --secondary-color: #D9613A;
    --background-color: #ffffff;
    --site-bg-color: #f8f9fa;
    --card-bg-color: #FFFFFF;
    --text-color: #212529;
    --text-muted: #6c757d;
    --text-light-color: #FFFFFF;
    --border-color: #e9ecef;
    --font-family: 'iranyekan', sans-serif;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --danger-color: #E74C3C;
}

/* --- General & Reset Styles --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    direction: rtl;
    overflow-x: hidden;
    background-color: var(--site-bg-color);
}

body.modal-open {
    overflow: hidden;
}


a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style-type: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button,
input,
select,
textarea {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light-color);
    border-radius: var(--border-radius-md);
}

/* ================================================================
   HERO SLIDER STYLES
================================================================ */
.hero-section {
    position: relative;
    width: 100%;
    height: 450px;
    background: #000;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 150%;
    padding-bottom: 104%;
    background-color: var(--site-bg-color);
    transform: translateX(-50%) translateY(50%);
    z-index: 2;
    border-radius: 0;
}

/* --- MODIFICATION START: Hero Header Layout --- */
.hero-header {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    padding: 0 25px;
    display: grid;
    /* Changed from flex to grid */
    grid-template-columns: 1fr auto 1fr;
    /* Equal side columns, auto center */
    align-items: start;
    /* Vertically center all items */
    z-index: 20;
}

.hero-header>.hero-icon-link:first-child {
    justify-self: start;
    /* Align left icon to the start */
}

.hero-header>.hero-logo-container {
    justify-self: center;
    /* Center the logo block */
    text-align: center;
    /* Center the h1 text inside */
}

.hero-header>.hero-icon-link:last-child {
    justify-self: end;
    /* Align right icon to the end */
}

/* --- MODIFICATION END --- */

.hero-icon-link {
    font-size: 1.5rem;
    color: var(--text-light-color);
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-logo-container img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    padding: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
    /* Ensure image itself is centered within the container */
}

.hero-logo-container h1 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 10px;
    color: var(--text-light-color);
}

.hero-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.hero-main-image {
    position: absolute;
    top: 50%;
    left: 5%;
    transform: translateY(-50%);
    width: 65%;
    max-width: 450px;
    filter: drop-shadow(0px 15px 20px rgba(0, 0, 0, 0.4));
    z-index: 12;
}

.hero-main-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.hero-thumbnails {
    position: absolute;
    top: 50%;
    right: 10%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    z-index: 15;
}

.thumbnail-item {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    background-color: #fff;
    padding: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.thumbnail-item.active {
    border-color: var(--secondary-color);
    transform: scale(1.15);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ================================================================
   STICKY HEADER & MENU (REDESIGNED)
================================================================ */
.main-container {
    padding: 20px;
    margin-top: -120px;
    position: relative;
    z-index: 3;
    background-color: var(--site-bg-color);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    padding-top: 80px;
}

.sticky-header-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #F8F9FA;
    padding: 15px 15px 0 15px;
}

.category-nav {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.category-nav-action {
    flex-shrink: 0;
    padding: 8px;
    margin-left: 8px;
}

.category-nav-action img {
    width: 24px;
    height: 24px;
    display: block;
}

.category-chips-wrapper {
    display: flex;
    flex-grow: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-chips-wrapper::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex-shrink: 0;
    padding: 15px 5px;
    margin: 0 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    border-radius: 0;
    border: none;
    background-color: transparent;
}

.category-chip.active {
    color: var(--text-color);
    font-weight: 800;
    background-color: transparent;
    border-color: transparent;
}

.category-chip.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}


/* ================================================================
   PRODUCT LIST & CARDS (NEW DESIGN)
================================================================ */
.product-grid-grouped {
    width: 100%;
    padding-top: 20px;
}

.category-section-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 20px 0;
    color: var(--text-color);
    border-right: 5px solid var(--primary-color);
    padding-right: 15px;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.product-card {
    display: flex;
    direction: ltr;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px dashed var(--border-color);
    background: none;
    box-shadow: none;
    border-radius: 0;
    cursor: pointer;
}

.product-card-left {
    width: 120px;
    flex-shrink: 0;
}

.product-card-image {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 10px;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-card-right {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    direction: rtl;
}

.product-card-right h3 {
    font-size: 1.0rem;
    font-weight: 800;
    margin-bottom: 25px;
    margin-top: 10px;
}

.product-card-right p {
    font-size: 0.9rem;
    color: var(--text-muted);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.product-card-right .product-price {
    font-size: 1.0rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: auto;
    display: flex;
    justify-content: end;
}

.product-card-right svg {
    padding: 3;
}

.add-to-cart-btn {
    width: 100%;
    background: var(--secondary-color);
    border: none;
    padding: 12px;
    border-radius: var(--border-radius-md);
    color: var(--text-light-color);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart-btn:hover {
    opacity: 0.9;
}


/* ================================================================
   MODALS, OVERLAYS, SIDEBAR (REDESIGNED)
================================================================ */
.modal-overlay,
.sidebar-overlay,
.cart-panel-overlay,
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s linear;
}

.modal-overlay.visible,
.sidebar-overlay.visible,
.cart-panel-overlay.visible,
.search-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.sidebar-nav,
.cart-summary-panel {
    transition: transform 0.4s ease-in-out, right 0.4s ease-in-out;
}

/* NEW: Sidebar Styles */
.sidebar-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    color: var(--text-light-color);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transition: right 0.4s ease;
}

.sidebar-nav.visible {
    right: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-logo {
    height: 40px;
    width: auto;
}

.close-sidebar-btn {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light-color);
}

.close-sidebar-btn i {
    font-size: 1.5rem;
}

.sidebar-body {
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-body ul {
    padding: 10px 0;
}

.sidebar-body li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-light-color);
}

.sidebar-body .category-count {
    font-weight: 400;
    font-size: 1.1rem;
}

.search-overlay {
    z-index: 4000;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
}

.search-overlay-content {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

#full-search-input {
    flex-grow: 1;
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border: 1px solid var(--border-color);
    background: var(--background-color);
    border-radius: var(--border-radius-md);
}

#full-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.close-search-btn {
    font-size: 2rem;
    color: var(--text-muted);
}

#search-results-container {
    flex-grow: 1;
    overflow-y: auto;
}

#search-results-container .product-card {
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
}

/* ================================================================
   RECOLORED PRODUCT MODAL STYLES
================================================================ */
.product-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    /* MODAL BG IS GREEN */
    color: var(--text-light-color);
    /* DEFAULT TEXT IS WHITE */
    border-radius: 30px 30px 0 0;
    z-index: 3001;
    transform: translateY(100%);
    transition: transform 0.4s ease-in-out;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.product-modal.visible {
    transform: translateY(0);
}

.modal-drag-handle {
    width: 50px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.4);
    /* Lighter handle for contrast */
    border-radius: 3px;
    margin: 15px auto;
}

.modal-content-body {
    padding: 0 25px 25px;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-image-wrapper {
    width: 100%;
    height: 250px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    background-color: var(--card-bg-color);
    /* White background for image */
}

.modal-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-product-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-light-color);
    /* White text */
}

.modal-product-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    /* Slightly transparent white */
    margin: 10px 0 25px;
}

.modal-details-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-light-color);
    /* White text */
}

.modal-details-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 5px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
    color: var(--text-light-color);
    /* White text */
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: var(--secondary-color);
    /* FOOTER BG IS ORANGE */
    color: var(--text-light-color);
    /* FOOTER TEXT IS WHITE */
    flex-shrink: 0;
}

.modal-price-tag {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-light-color);
}

.modal-footer .product-action-wrapper .add-to-cart-btn {
    background-color: var(--text-light-color);
    color: var(--secondary-color);
    font-weight: 700;
    padding: 12px 25px;
    height: 45px;
    width: 150px;
    border-radius: var(--border-radius-md);
}

/* --- FIX FOR QUANTITY SELECTOR --- */
.modal-footer .product-action-wrapper .quantity-control {
    display: flex;
    align-items: center;
    /* Vertical centering */
    justify-content: space-between;
    /* Distribute items */
    border: 2px solid var(--text-light-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    height: 45px;
    width: 150px;
}

.modal-footer .quantity-control .quantity-btn {
    flex: 1 1 0;
    background: transparent;
    color: var(--text-light-color);
    font-size: 1.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-footer .quantity-control .quantity-input {
    flex: 1.2 1 0;
    background: transparent;
    color: var(--text-light-color);
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
    border: none;
    padding: 0;
    width: 40px;
    /* Give it a base width */
}


/* ================================================================
   CART (FAB, PANEL, FINAL PAGE) - SEMI-CIRCLE DESIGN
================================================================ */
.cart-fab {
    position: fixed;
    bottom: 30px;
    left: 85%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: var(--text-light-color);
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: none;
    align-items: center;
    padding: 10px 20px;
    gap: 10px;
    z-index: 1010;
    cursor: pointer;
}

.cart-fab.visible {
    display: flex;
}

.cart-fab i {
    font-size: 1.5rem;
}

.cart-fab .cart-badge {
    background: var(--secondary-color);
}

.cart-summary-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    background-color: transparent;
    z-index: 2001;
    transform: translateY(100%);
    display: flex;
    flex-direction: column;
    height: 55vh;
}

.cart-summary-panel.visible {
    transform: translateY(0);
}

.panel-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    /* This creates the semi-circle effect */
    border-radius: 30px 30px 0 0;
    z-index: -1;
}

.panel-logo {
    position: absolute;
    top: 20px;
    /* Adjust to fit the new curve */
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    /* Slightly smaller logo */
    height: auto;
}

.panel-header {
    padding: 20px;
    position: relative;
    flex-shrink: 0;
}

.close-panel-btn {
    position: absolute;
    top: 30px;
    left: 30px;
    font-size: 1.5rem;
    color: var(--text-light-color);
}

.panel-cart-items {
    overflow-y: auto;
    /* Increase top padding to clear the new curved top and logo */
    padding: 100px 20px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel-cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--card-bg-color);
    padding: 10px;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.panel-cart-item::before {
    display: none;
}

.panel-cart-item img {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-md);
    object-fit: cover;
}

.panel-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.panel-item-details h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

.panel-item-details p {
    font-size: 1rem;
    color: var(--text-muted);
}

.panel-footer {
    padding: 20px;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.total-price-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg-color);
    padding: 15px;
    border-radius: var(--border-radius-md);
    margin-bottom: 15px;
    font-size: 1.0rem;
    font-weight: 500;
}

.checkout-btn {
    display: block;
    width: 100%;
    padding: 15px;
    text-align: center;
    background-color: var(--secondary-color);
    color: var(--text-light-color);
    border-radius: var(--border-radius-md);
    font-size: 1.2rem;
    font-weight: 700;
}

.checkout-btn.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* --- STYLES FOR QUANTITY CONTROLLERS --- */
.product-card-left .quantity-control {
    width: 100%;
    display: flex;
    align-items: stretch;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    height: 30px;
}

.product-card-left .quantity-control .quantity-btn {
    flex: 1 1 0;
    border: none;
    background: transparent;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.product-card-left .quantity-control .quantity-input {
    flex: 1.5 1 0;
    width: 40px;
    background-color: white;
    border: none;
    text-align: center;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0 5px;
    -moz-appearance: textfield;
    appearance: textfield;
}

.product-card-left .quantity-control .quantity-input::-webkit-outer-spin-button,
.product-card-left .quantity-control .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.panel-cart-item .quantity-control {
    background-color: #f0f0f0;
    height: auto;
    width: auto;
    display: inline-flex;
    border-radius: var(--border-radius-md);
}

.panel-cart-item .quantity-control .quantity-btn {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    font-size: 1.2rem;
    background-color: var(--secondary-color);
    color: var(--text-light-color);
    border-radius: var(--border-radius-md);
}

.panel-cart-item .quantity-control .quantity-input {
    flex: 1;
    width: 35px;
    height: auto;
    background: transparent;
    color: var(--text-color);
    text-align: center;
}


/* ================================================================
   FINAL CART PAGE - REDESIGNED (`cart.php`)
================================================================ */
.cart-page-body {
    background-color: var(--primary-color);
}

.final-cart-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding-top: 150px;
    display: flex;
    flex-direction: column;
}

.final-cart-wrapper .panel-background {
    border-radius: 0;
}

.final-cart-wrapper .panel-logo {
    top: 40px;
    width: 100px;
}

.final-cart-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light-color);
}

.final-cart-header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.final-cart-header .back-to-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    z-index: 5;
}

.cart-page-container {
    padding: 0 20px 20px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#final-cart-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow-y: auto;
}

.final-cart-item-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--card-bg-color);
    padding: 15px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 15px;
}

.final-cart-item-card img {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.final-cart-item-card .details {
    flex-grow: 1;
    text-align: right;
}

.final-cart-item-card .details h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
}

.final-cart-item-card .details p {
    font-size: 1rem;
    color: var(--text-muted);
}

.final-cart-item-card .price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-color);
    flex-shrink: 0;
    margin-right: auto;
}


#empty-cart-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 50px 20px;
}

#empty-cart-message i {
    font-size: 5rem;
    margin-bottom: 20px;
}

#empty-cart-message h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.final-cart-summary {
    background-color: var(--secondary-color);
    color: var(--text-light-color);
    padding: 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-top: auto;
    flex-shrink: 0;
}

.final-cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.final-cart-summary .summary-row:last-child {
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 0;
}

.panel-item-price {
    font-weight: 700;
}


/* ================================================================
   UTILITIES & RESPONSIVE
================================================================ */
.loader-container {
    padding: 50px;
    text-align: center;
}

.loader {
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-container {
        padding: 40px;
        margin-top: -120px;
        padding-top: 80px;
    }

    .sticky-header-container {
        padding: 15px 40px 0;
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ADDED: Custom styles for SVG icons in header */
.header-svg-icon {
    width: 23px;
    height: 23px;
}

:root {
    --primary-color: #0A4F3B;
    --secondary-color: #D9613A;
    --background-color: #ffffff;
    --site-bg-color: #f8f9fa;
    --card-bg-color: #FFFFFF;
    --text-color: #212529;
    --text-muted: #6c757d;
    --text-light-color: #FFFFFF;
    --border-color: #e9ecef;
    --font-family: 'iranyekan', sans-serif;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --danger-color: #E74C3C;
}

/* ... (Keep all existing styles from the previous version) ... */

/* --- ADDED/MODIFIED STYLES FOR ADDONS --- */

/* In Product Card: a summary for items in cart */
.quantity-summary {
    width: 100%;
    background: var(--primary-color);
    border: none;
    padding: 12px;
    border-radius: var(--border-radius-md);
    color: var(--text-light-color);
    font-weight: 500;
    font-size: 0.9rem;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.quantity-summary span {
    font-weight: 700;
    margin-left: 5px;
}


/* In Modal: Addon Section Styles */
.addon-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.addon-options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.addon-option {
    display: flex;
}

.addon-option input[type="checkbox"] {
    display: none;
    /* Hide default checkbox */
}

.addon-option label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.addon-option input[type="checkbox"]:checked+label {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--secondary-color);
}

.addon-option .addon-name {
    font-weight: 500;
    font-size: 1rem;
}

.addon-option .addon-price {
    font-weight: 700;
    font-size: 1rem;
    color: var(--secondary-color);
}

/* In Modal: Footer Price container */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: var(--secondary-color);
    color: var(--text-light-color);
    flex-shrink: 0;
}

.modal-price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.modal-price-container small {
    font-size: 0.8rem;
    opacity: 0.9;
}

.modal-price-tag {
    font-size: 1.5rem;
    font-weight: 800;
}

.modal-footer .add-to-cart-btn {
    background-color: var(--text-light-color);
    color: var(--secondary-color);
    font-weight: 700;
    padding: 12px 25px;
    height: 45px;
    width: 150px;
    border-radius: var(--border-radius-md);
}

/* In Cart Panel: Addon List */
.panel-item-addons {
    list-style-type: none;
    padding: 0;
    margin: 5px 0 0 0;
}

.panel-item-addons li {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-right: 10px;
    position: relative;
}

.panel-item-addons li::before {
    content: '+';
    position: absolute;
    right: 0;
    top: 0;
}

/* In Final Cart Page: Addon List */
.final-cart-item-addons {
    list-style-type: none;
    padding: 0;
    margin: 5px 0 0 0;
}

.final-cart-item-addons li {
    font-size: 0.9rem;
    color: var(--text-muted);
}

:root {
    --primary-color: #0A4F3B;
    --secondary-color: #D9613A;
    --background-color: #ffffff;
    --site-bg-color: #f8f9fa;
    --card-bg-color: #FFFFFF;
    --text-color: #212529;
    --text-muted: #6c757d;
    --text-light-color: #FFFFFF;
    --border-color: #e9ecef;
    --font-family: 'iranyekan', sans-serif;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --danger-color: #E74C3C;
}

/* ... (Keep all existing mobile-first styles here) ... */
.mobile-layout {
    display: block;
}
.desktop-layout {
    display: none;
}


/* ================================================================
   DESKTOP LAYOUT STYLES (Applies on screens >= 1024px)
================================================================ */
@media (min-width: 1024px) {
    .mobile-layout,
    .cart-fab,
    .cart-summary-panel,
    .cart-panel-overlay {
        display: none !important; /* Hide all mobile-specific elements */
    }

    .desktop-layout {
        display: grid;
        /* grid-template-columns: 280px 1fr 360px; */
        grid-template-columns: 280px 1fr;
        height: 100vh;
        overflow: hidden;
        background-color: var(--site-bg-color);
    }
    
    body {
        overflow: hidden; /* Prevent body scroll on desktop */
    }

    /* --- Left Sidebar (Categories) --- */
    .desktop-sidebar-left {
        background-color: #fff;
        padding: 20px;
        border-left: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
        height: 100vh;
    }
    .desktop-logo-container {
        text-align: center;
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0; /* Prevent logo from shrinking */
    }
    .desktop-logo-container img {
        max-width: 100px;
        margin: 0 auto;
    }
    
    /* FIX: Added flex-grow and overflow-y to make the nav scrollable */
    .desktop-category-nav {
        flex-grow: 1;
        overflow-y: auto;
    }

    .desktop-category-nav ul {
        list-style: none;
        padding: 0;
    }
    .desktop-category-link {
        display: flex;
        align-items: center;
        padding: 15px 10px;
        border-radius: var(--border-radius-md);
        margin-bottom: 5px;
        font-size: 1rem;
        font-weight: 500;
        color: var(--text-muted);
        transition: all 0.2s ease-in-out;
    }
    .desktop-category-link i {
        margin-left: 15px;
        font-size: 1.2rem;
        width: 20px;
        text-align: center;
    }
    .desktop-category-link:hover {
        background-color: var(--site-bg-color);
        color: var(--text-color);
    }
    .desktop-category-link.active {
        background-color: var(--primary-color);
        color: var(--text-light-color);
        font-weight: 700;
    }

    /* --- Main Content (Products) --- */
    .desktop-main-content {
        overflow-y: auto;
        padding: 20px 30px;
    }
    .desktop-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
    }
    .desktop-header h1 {
        font-size: 1.8rem;
        font-weight: 800;
    }
    .desktop-search-wrapper {
        position: relative;
        width: 300px;
    }
    .desktop-search-wrapper i {
        position: absolute;
        top: 50%;
        right: 15px;
        transform: translateY(-50%);
        color: var(--text-muted);
    }
    #desktop-search-input {
        width: 100%;
        padding: 12px 40px 12px 15px;
        border-radius: var(--border-radius-md);
        border: 1px solid var(--border-color);
        font-size: 1rem;
    }
    #desktop-search-input:focus {
        outline: none;
        border-color: var(--primary-color);
    }
    
    #product-list-desktop .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
    
    #product-list-desktop .product-card {
        flex-direction: column;
        direction: rtl;
        padding: 0;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius-lg);
        background-color: #fff;
        overflow: hidden;
        box-shadow: none;
        transition: all 0.2s ease-in-out;
    }
     #product-list-desktop .product-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow);
     }
    #product-list-desktop .product-card-left {
        width: 100%;
    }
    #product-list-desktop .product-card-image {
        width: 100%;
        height: 200px;
        border-radius: 0;
        margin-bottom: 0;
    }
    #product-list-desktop .product-card-right {
        padding: 15px;
        display: flex;
        flex-direction: column;
        flex-grow: 1; /* Allow right card to grow */
    }
    #product-list-desktop .product-card-right .product-price {
        margin-top: auto; /* Push price to the bottom */
    }
    #product-list-desktop .product-action-wrapper {
        padding: 0 15px 15px;
    }
}

:root { 
    --primary-color: #0A4F3B;
    --secondary-color: #D9613A;
    --background-color: #ffffff;
    --site-bg-color: #f8f9fa;
    --card-bg-color: #FFFFFF;
    --text-color: #212529;
    --text-muted: #6c757d;
    --text-light-color: #FFFFFF;
    --border-color: #e9ecef;
    --font-family: 'iranyekan', sans-serif;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --danger-color: #E74C3C;
}

/* ... (Keep all existing base styles here) ... */
.mobile-layout { display: block; }
.desktop-layout { display: none; }

/* --- FIX: Dropdown Styles --- */
.contact-dropdown-wrapper {
    position: relative;
    z-index: 50;
    display: flex;
    justify-content: flex-end; /* Aligns button to the left in RTL */
    align-items: center;
}
.contact-dropdown-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.contact-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    /* FIX: Changed from left to right for correct opening direction */
    right: auto;
    left: 0;
    background-color: #fff;
    border-radius: var(--border-radius-md);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    min-width: 150px;
	max-width: 200px;
    padding: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.2s ease-in-out;
    z-index: 100;
}
.contact-dropdown-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.contact-dropdown-menu ul { list-style: none; padding: 0; margin: 0; }
.contact-dropdown-menu li span { padding: 12px 15px; color: var(--text-muted); font-size: 0.9rem; text-align: center; display: block; }
.contact-dropdown-menu li a { display: flex; align-items: center; padding: 8px 15px; color: var(--text-color); font-size: 0.95rem; border-radius: 8px; transition: background-color 0.2s; }
.contact-dropdown-menu li a:hover { background-color: var(--site-bg-color); }
.contact-dropdown-menu li a i { margin-left: 12px; font-size: 1.1rem; color: var(--primary-color); width: 20px; }


/* --- FIX: Product Card Structure for Mobile --- */
.product-card {
    display: flex;
    direction: ltr;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px dashed var(--border-color);
}
.product-card-left {
    width: 120px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.product-card-image {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.product-action-wrapper {
    margin-top: 10px;
}
.product-card-right {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    direction: rtl;
}
.product-card-right h3 { font-size: 1.0rem; font-weight: 800; margin-bottom: 5px; margin-top: 10px; }
.product-card-right p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 10px; }
.product-card-right .product-price { font-size: 1.0rem; font-weight: 700; color: var(--text-color); margin-top: auto; }


/* ================================================================
   DESKTOP LAYOUT STYLES
================================================================ */
@media (min-width: 1024px) {
    .mobile-layout, .cart-fab, .cart-summary-panel, .cart-panel-overlay {
        display: none !important;
    }
    .desktop-layout {
        display: grid;
        /* grid-template-columns: 280px 1fr 360px; */
        grid-template-columns: 280px 1fr;
        height: 100vh;
        overflow: hidden;
        background-color: var(--site-bg-color);
    }
    body { overflow: hidden; }

    .desktop-sidebar-left { background-color: #fff; padding: 20px; border-left: 1px solid var(--border-color); display: flex; flex-direction: column; height: 100vh; }
    .desktop-logo-container { text-align: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
    .desktop-logo-container img { max-width: 100px; margin: 0 auto; }
    .desktop-category-nav { flex-grow: 1; overflow-y: auto; }
    .desktop-category-nav ul { list-style: none; padding: 0; }
    .desktop-category-link { display: flex; align-items: center; padding: 15px 10px; border-radius: var(--border-radius-md); margin-bottom: 5px; font-size: 1rem; font-weight: 500; color: var(--text-muted); transition: all 0.2s ease-in-out; }
    .desktop-category-link i { margin-left: 15px; font-size: 1.2rem; width: 20px; text-align: center; }
    .desktop-category-link:hover { background-color: var(--site-bg-color); color: var(--text-color); }
    .desktop-category-link.active { background-color: var(--primary-color); color: var(--text-light-color); font-weight: 700; }
    .desktop-main-content { overflow-y: auto; padding: 20px 30px; }
    .desktop-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
    .desktop-header h1 { font-size: 1.8rem; font-weight: 800; }
    .desktop-search-wrapper { position: relative; width: 300px; }
    .desktop-search-wrapper i { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); color: var(--text-muted); }
    #desktop-search-input { width: 100%; padding: 12px 40px 12px 15px; border-radius: var(--border-radius-md); border: 1px solid var(--border-color); font-size: 1rem; }
    #desktop-search-input:focus { outline: none; border-color: var(--primary-color); }
    #product-list-desktop .product-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
    
    #product-list-desktop .product-card {
        flex-direction: column;
        direction: rtl;
        padding: 10px !important;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius-lg);
        background-color: #fff;
        overflow: hidden;
        box-shadow: none;
        transition: all 0.2s ease-in-out;
    }
    #product-list-desktop .product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
    #product-list-desktop .product-card-left { width: 100%; flex-direction: column; }
    #product-list-desktop .product-card-image { width: 100%; height: 200px; border-radius: 0; margin-bottom: 0; }
    #product-list-desktop .product-card-right { padding: 15px; flex-grow: 1; }
    #product-list-desktop .product-action-wrapper { padding: 0 15px 15px; }
}