:root {
    /* New color palette */
    --color-1: #d4e109;   /* Цвет №1 */
    --color-2: #535358;   /* Цвет №2 */
    --color-3: #7f9922;   /* Цвет №3 */
    --color-4: #797a7d;   /* Цвет №4 */
    --color-5: #5f681f;   /* Цвет №5 */
    --color-6: #262527;   /* Цвет №6 */
    --color-7: #69782c;   /* Цвет №7 */
    --color-8: #ecede6;   /* Цвет №8 */
    --color-9: #adaeaf;   /* Цвет №9 */
    --color-10: #414926;  /* Цвет №10 */

    /* Font families */
    --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-secondary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Font weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Updated theme variables with fallbacks for app variables */
    --tg-theme-bg-color: var(--app-bg-color, var(--color-8));
    --tg-theme-text-color: var(--app-text-color, var(--color-6));
    --tg-theme-hint-color: var(--app-hint-color, var(--color-4));
    --tg-theme-link-color: var(--app-link-color, var(--color-7));
    --tg-theme-button-color: var(--app-button-color, var(--color-1));
    --tg-theme-button-text-color: var(--app-button-text-color, var(--color-6));
    --tg-theme-secondary-bg-color: var(--app-secondary-bg-color, var(--color-8));
    --card-shadow: 0 4px 8px rgba(0,0,0,0.05);
    --border-radius: 12px;
    --transition-speed: 0.3s;
    
    /* Letter spacing */
    --letter-spacing-tight: -0.02em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.02em;

    /* Additional variables for better theme adaptation */
    --border-light: rgba(0,0,0,0.1);
    --border-dark: rgba(255,255,255,0.1);
    --shadow-light: 0 4px 8px rgba(0,0,0,0.08);
    --shadow-dark: 0 4px 8px rgba(0,0,0,0.2);
    --hover-light: rgba(0,0,0,0.05);
    --hover-dark: rgba(255,255,255,0.05);
    
    /* Adaptive borders and shadows based on theme */
    --adaptive-border: var(--border-light);
    --adaptive-shadow: var(--shadow-light);
    --adaptive-hover: var(--hover-light);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Use the new body-bg-color variable for backgrounds */
body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-normal);
    margin: 0;
    padding: 0;
    background-color: var(--tg-theme-bg-color, #f5f5f5); /* Use Telegram's native bg color */
    color: var(--tg-theme-text-color, #262626);
    line-height: 1.5;
    letter-spacing: var(--letter-spacing-normal);
}

body.in-telegram {
    /* Let Telegram handle the color scheme naturally */
    color: var(--tg-theme-text-color);
}

body.in-browser {
    /* These styles will only apply when running in a regular browser */
    background-color: #f5f5f5;
    color: var(--color-6);
}

/* Apply different adaptive values for dark mode */
body.dark-mode {
    --adaptive-border: var(--border-dark);
    --adaptive-shadow: var(--shadow-dark);
    --adaptive-hover: var(--hover-dark);
}

/* Remove the dark/light mode specific background colors and let Telegram control it */
/* 
body.dark-mode {
    background-color: #1c1c1c;
}

body.light-mode {
    background-color: #f5f5f5;
} 
*/

/* Force text colors to respect theme */
body,
h1, h2, h3, h4, h5, h6,
p, span, div {
    color: var(--tg-theme-text-color);
}

#app {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px 20px; /* Reduce bottom padding since we removed the nav bar */
}

/* Updated Header for True Full Width */
.header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw; /* Use viewport width for truly full width */
    margin-left: calc(-50vw + 50%); /* Center the element regardless of parent width */
    margin-right: calc(-50vw + 50%);
    background-color: var(--tg-theme-bg-color);
    z-index: 10;
    padding: 0;
    margin-bottom: 20px;
    border-bottom: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Inner header content container for padding and alignment */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 18px 15px;
}

.header h1 {
    margin: 0;
    font-size: 24px;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, var(--color-3), var(--color-1));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: var(--letter-spacing-tight);
    position: relative;
    padding-left: 15px;
    cursor: pointer; /* Add cursor pointer to indicate it's clickable */
    transition: transform 0.2s ease; /* Add subtle hover effect */
}

.header h1:hover {
    transform: translateY(-2px); /* Slight lift on hover */
}

.header h1:active {
    transform: scale(0.98); /* Slight press effect on click */
}

.header h1::before {
    content: '';
    position: absolute;
    left: 0;
    height: 80%;
    width: 6px;
    background: linear-gradient(to bottom, var(--color-3), var(--color-1));
    border-radius: 3px;
    top: 10%;
}

.header-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.03);
    cursor: pointer;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.icon-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.icon-button:active::after {
    opacity: 1;
}

.icon-button:hover {
    background-color: rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.icon-button svg {
    width: 22px;
    height: 22px;
    stroke: var(--tg-theme-text-color);
    transition: transform var(--transition-speed);
}

.icon-button:active svg {
    transform: scale(0.9);
}

/* Cart Button */
.cart-button {
    background: var(--tg-theme-button-color, var(--color-1));
    color: var(--tg-theme-button-text-color, var(--color-6));
    border: none;
    padding: 9px 18px;
    border-radius: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: var(--font-weight-medium);
    font-family: var(--font-primary);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.cart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.cart-button:active {
    transform: scale(0.97);
}

.cart-button span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--tg-theme-button-text-color, white);
    margin-left: 10px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

/* Wishlist indicator in header */
#wishlist-button {
    position: relative;
}

/* Remove the old wishlist indicator */
#wishlist-button.has-items:after {
    content: none;
}

/* Revised styling for wishlist count badge */
#wishlist-count {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background-color: #ff5252;
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Enhanced selectors to hide wishlist count when empty or zero */
#wishlist-count:empty,
#wishlist-count[data-count="0"],
#wishlist-count:empty + .count-text,
#wishlist-count[data-count="0"] + .count-text,
#wishlist-count[textContent="0"],
#wishlist-count:empty:before,
#wishlist-count:not([data-count]),
#wishlist-count[data-count=""] {
    display: none !important;
}

/* For mobile screens, optimize the header layout */
@media (max-width: 600px) {
    #app {
        padding: 0 10px 20px; /* Reduce bottom padding since we removed the nav bar */
    }
    
    .header-content {
        padding: 15px 10px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .icon-button {
        width: 38px;
        height: 38px;
    }
    
    .cart-button {
        padding: 7px 14px;
    }
    
    .cart-button span {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
}

.search-container {
    margin-bottom: 20px;
}

#search-input {
    width: 100%;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0,0,0,0.08);
    background-color: white;
    font-size: 16px;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
    margin-bottom: 10px;
}

#search-input:focus {
    outline: none;
    border-color: var(--tg-theme-button-color);
    box-shadow: 0 0 0 2px rgba(64, 167, 227, 0.1);
}

.category-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 5px 0;
    scrollbar-width: none; /* Firefox */
}

.category-filters::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.category-filter {
    padding: 6px 14px;
    background-color: white;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.category-filter.active {
    background-color: var(--tg-theme-button-color);
    color: var(--color-6); /* Changed from white to var(--color-6) which is black */
    border-color: var(--tg-theme-button-color);
}

/* Products Grid */
.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
    background-color: transparent; /* Ensure this is transparent */
}

#products-container .product-item {
    opacity: 1 !important; /* Ensure product items are visible */
}

/* Make entire product item clickable except the button */
.product-item {
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
    position: relative;
    border: 1px solid #ddd;
    cursor: pointer; /* Make the entire card clickable */
}

.product-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.product-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.product-item h3 {
    margin: 12px 15px 8px;
    font-size: 16px;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    color: var(--tg-theme-text-color);
    letter-spacing: var(--letter-spacing-tight);
}

.product-item p {
    margin: 0 15px;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-item .price {
    margin: 10px 15px;
    font-weight: var(--font-weight-bold);
    font-size: 18px;
    color: var(--tg-theme-text-color);
}

/* Ensure the add-to-cart button stays above the clickable area */
.add-to-cart {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 5px 15px 15px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-normal);
    transition: background-color var(--transition-speed), transform var(--transition-speed);
    position: relative;
    z-index: 2; /* Ensure button stays on top */
}

.add-to-cart:active {
    transform: scale(0.97);
}

/* Update the button styling to match the design theme */
.view-product-btn {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 5px 15px 15px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-normal);
    transition: background-color var(--transition-speed), transform var(--transition-speed);
    position: relative;
    z-index: 2; /* Ensure button stays on top */
    width: calc(100% - 30px); /* Make button take full width minus margins */
    text-align: center;
}

.view-product-btn:active {
    transform: scale(0.97);
}

.hidden {
    display: none;
}

/* Cart Styling */
.cart-container {
    padding: 16px;
}

.cart-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.back-to-products {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--tg-theme-button-color, #2481cc);
    padding: 8px 0;
    cursor: pointer;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--tg-theme-hint-color, #999);
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.item-price {
    margin: 0;
    color: var(--tg-theme-hint-color, #999);
    font-size: 14px;
}

.item-total {
    margin: 4px 0 0 0;
    font-weight: bold;
}

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

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--tg-theme-button-color, #2481cc);
    background: none;
    color: var(--tg-theme-button-color, #2481cc);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.quantity {
    width: 30px;
    text-align: center;
    font-weight: bold;
}

.remove-btn {
    background: none;
    border: none;
    color: #ff5252;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
}

.cart-total {
    background-color: var(--tg-theme-secondary-bg-color, #f0f0f0);
    padding: 16px;
    border-radius: 12px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.checkout-btn {
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    background-color: var(--tg-theme-button-color, #2481cc);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.continue-btn {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background-color: rgba(177, 222, 247, 0.25); /* Світліший напівпрозорий фон */
    border: 1px solid var(--tg-theme-button-color, #2481cc);
    color: var(--tg-theme-button-color, #2a94eb);
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    text-align: center;
}

.empty-cart svg {
    color: var(--tg-theme-hint-color, #999);
    margin-bottom: 16px;
}

.empty-cart p {
    margin: 8px 0 24px;
    color: var(--tg-theme-hint-color, #999);
}

.continue-shopping {
    padding: 10px 20px;
    background-color: var(--tg-theme-button-color, #2481cc);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.order-confirmation {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.order-success {
    text-align: center;
    margin-bottom: 24px;
}

.order-success svg {
    color: #4caf50;
    margin-bottom: 16px;
}

.order-success h2 {
    margin: 8px 0;
}

.order-summary {
    width: 100%;
    background-color: var(--tg-theme-secondary-bg-color, #f0f0f0);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.order-summary h3 {
    margin-top: 0;
}

/* Cart Styling */
.cart-container {
    padding: 5px 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    box-shadow: var(--card-shadow);
}

.item-info h4 {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
}

.item-info p {
    margin: 0;
    color: var(--tg-theme-hint-color);
}

.item-controls {
    display: flex;
    align-items: center;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.quantity-btn:hover {
    background-color: rgba(0,0,0,0.04);
}

.quantity {
    margin: 0 12px;
    font-size: 16px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.cart-total {
    margin-top: 20px;
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.cart-total h3 {
    margin: 0 0 15px;
    font-size: 18px;
    text-align: right;
}

.checkout-btn {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform var(--transition-speed);
    box-shadow: 0 4px 8px rgba(64, 167, 227, 0.2);
}

.checkout-btn:active {
    transform: scale(0.98);
}

.empty-cart, .empty-wishlist, .empty-orders, .empty-profile {
    text-align: center;
    padding: 40px 20px;
    color: var(--tg-theme-hint-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.empty-cart svg, .empty-wishlist svg, .empty-orders svg, .empty-profile svg {
    stroke: var(--tg-theme-hint-color);
    opacity: 0.5;
    margin-bottom: 15px;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0,0,0,0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: 500;
    z-index: 100;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Wishlist styling */
.wishlist-container {
    padding: 5px 0;
}

.wishlist-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wishlist-item {
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-speed);
    border-left: 3px solid var(--color-1);
}

.wishlist-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.wishlist-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wishlist-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.wishlist-item-info h4 {
    margin: 0 0 5px;
    font-weight: 600;
    font-size: 16px;
}

.wishlist-item-info .item-price {
    font-weight: bold;
    color: var(--color-3);
    margin: 0 0 6px 0;
}

.wishlist-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wishlist-add-btn {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.wishlist-add-btn:hover {
    background-color: var(--color-3);
    transform: translateY(-2px);
}

.remove-from-wishlist {
    background: none;
    border: none;
    color: #ff5252;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all var(--transition-speed);
}

.remove-from-wishlist:hover {
    background-color: rgba(255, 82, 82, 0.1);
}

/* Wishlist button in detail and header */
.add-to-wishlist {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--tg-theme-hint-color, rgba(0,0,0,0.1));
    background-color: var(--tg-theme-secondary-bg-color, white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: var(--shadow-light, 0 2px 6px rgba(0,0,0,0.1));
}

.add-to-wishlist:hover {
    background-color: rgba(255, 82, 82, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 82, 82, 0.3);
}

.add-to-wishlist svg {
    stroke: var(--tg-theme-hint-color, #666);
    width: 22px;
    height: 22px;
    transition: all var(--transition-speed);
}

.add-to-wishlist.in-wishlist {
    background-color: rgba(255, 82, 82, 0.15);
    border-color: rgba(255, 82, 82, 0.4);
}

.add-to-wishlist.in-wishlist svg {
    fill: #ff5252;
    stroke: #ff5252;
}

.add-to-wishlist.in-wishlist:hover {
    background-color: rgba(255, 82, 82, 0.2);
    border-color: rgba(255, 82, 82, 0.5);
}

/* Dark theme specific adjustments for wishlist button */
@media (prefers-color-scheme: dark) {
    .add-to-wishlist {
        box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    }
}

/* For Telegram dark theme when CSS variables are set */
.add-to-wishlist {
    box-shadow: var(--shadow-light, 0 2px 6px rgba(0,0,0,0.1));
}

/* When Telegram provides dark theme variables */
[data-theme="dark"] .add-to-wishlist,
.tg-dark-theme .add-to-wishlist,
.dark-mode .add-to-wishlist {
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    border-color: var(--tg-theme-hint-color, rgba(255,255,255,0.2));
}

/* Enhanced dark mode styles for better visibility */
.dark-mode .add-to-wishlist {
    background-color: var(--tg-theme-secondary-bg-color, #3c3c3c);
    border-color: var(--tg-theme-hint-color, rgba(255,255,255,0.3));
}

.dark-mode .add-to-wishlist:hover {
    background-color: rgba(255, 82, 82, 0.15);
    border-color: rgba(255, 82, 82, 0.4);
}

.dark-mode .add-to-wishlist.in-wishlist {
    background-color: rgba(255, 82, 82, 0.2);
    border-color: rgba(255, 82, 82, 0.5);
}

/* Light mode specific adjustments */
.light-mode .add-to-wishlist {
    background-color: var(--tg-theme-secondary-bg-color, white);
    border-color: var(--tg-theme-hint-color, rgba(0,0,0,0.1));
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.light-mode .add-to-wishlist:hover {
    background-color: rgba(255, 82, 82, 0.08);
    border-color: rgba(255, 82, 82, 0.3);
}

/* Wishlist indicator in header */
#wishlist-button {
    position: relative;
}

/* Remove the old wishlist indicator */
#wishlist-button.has-items:after {
    content: none;
}

/* Revised styling for wishlist count badge to appear inside the heart */
#wishlist-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 1px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* Heart icon styling to accommodate the counter */
#wishlist-button svg {
    position: relative;
    z-index: 0;
}

/* Hide wishlist count when empty */
#wishlist-count:empty, 
#wishlist-count[data-count="0"] {
    display: none;
}

/* Update the wishlist heart icon styling */
#wishlist-button svg path {
    transition: fill 0.3s, stroke 0.3s;
}

/* Remove stroke when the heart is filled (has-items class) - make more specific */
#wishlist-button.has-items svg path {
    stroke: none !important; /* Add important to override any inline styles */
    stroke-width: 0;
    fill: #ff5252;
}

/* Make sure we target any heart icon inside wishlist buttons in the entire app */
.icon-button#wishlist-button.has-items svg path,
button#wishlist-button.has-items svg path {
    stroke: transparent;
    stroke-opacity: 0;
    stroke-width: 0;
}

/* Profile Card */
.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin: 20px 0;
}

.profile-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.profile-card h2 {
    margin: 20px 0 5px;
    font-size: 22px;
    font-weight: 600;
}

.profile-card p {
    font-size: 16px;
    color: var(--tg-theme-hint-color);
}

/* Product Detail */
.product-detail {
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.product-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.back-button {
    display: flex;
    align-items: center;
    border: none;
    background: none;
    color: var(--tg-theme-text-color);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
}

.back-button svg {
    margin-right: 5px;
}

/* Product Detail Page - Add age verification */
.age-verification {
    background-color: rgba(0, 0, 0, 0.8);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.age-verification-dialog {
    background-color: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
    padding: 20px;
    text-align: center;
}

.age-verification-dialog h2 {
    margin-top: 0;
    color: #4CAF50;
}

.age-verification-dialog p {
    margin-bottom: 20px;
}

.age-verification-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.age-verification-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
}

.age-verification-yes {
    background-color: #4CAF50;
    color: white;
}

.age-verification-no {
    background-color: #f44336;
    color: white;
}

/* Enhanced Product Detail Styling */
.product-detail-wrapper {
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.product-detail-content {
    display: flex;
    flex-direction: column;
}

.product-detail-image {
    width: 100%;
    position: relative;
    background-color: var(--tg-theme-secondary-bg-color, #f9f9f9);
    text-align: center;
    padding: 20px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.detail-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    margin: 0 auto;
}

.detail-info {
    padding: 20px;
}

.product-detail-header-info {
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    position: relative;
}

.product-detail-header-info h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    color: var(--tg-theme-text-color);
    line-height: 1.2;
    letter-spacing: var (--letter-spacing-tight);
}

.product-detail-header-info .price {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    color: var(--color-3);
    margin: 0;
}

.product-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.status-indicator {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.in-stock {
    background-color: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
}

.out-of-stock {
    background-color: rgba(244, 67, 54, 0.15);
    color: #d32f2f;
}

.category-tag {
    display: inline-block;
    padding: 4px 12px;
    background-color: rgba(33, 150, 243, 0.15);
    color: #1976d2;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h3 {
    font-size: 18px;
    font-family: var(--font-heading);
    margin: 0 0 10px 0;
    font-weight: var(--font-weight-semibold);
    color: var(--tg-theme-text-color);
    letter-spacing: var(--letter-spacing-tight);
}

.detail-section p {
    margin: 0;
    color: var(--tg-theme-hint-color);
    line-height: 1.6;
    font-size: 16px;
}

.flavor-section {
    background-color: rgba(76, 175, 80, 0.05);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid var(--color-3);
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 25px;
    overflow: hidden;
}

.detail-minus, .detail-plus {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--color-3);
}

.detail-quantity {
    width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.detail-add-btn {
    flex: 1;
    height: 46px;
    background-color: var(--color-1);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-family: var(--font-primary);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 25px;
    letter-spacing: var(--letter-spacing-normal);
    transition: transform 0.2s, box-shadow 0.2s;
}

.detail-add-btn:active {
    transform: scale(0.98);
}

/* Responsive styles for larger screens */
@media (min-width: 768px) {
    .product-detail-content {
        flex-direction: row;
    }
    
    .product-detail-image {
        width: 45%;
        border-radius: var(--border-radius) 0 0 var(--border-radius);
    }
    
    .detail-info {
        width: 55%;
    }
}

/* Animation for the detail page */
.product-detail {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .header {
        flex-direction: row;
        align-items: center;
        padding: 12px 0;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .header-buttons {
        gap: 8px;
    }
    
    .products-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .product-item h3 {
        font-size: 15px;
        margin: 10px 12px 6px;
    }
    
    .product-item p {
        margin: 0 12px;
        font-size: 13px;
    }
    
    .product-item .price {
        margin: 8px 12px;
    }
    
    .add-to-cart {
        margin: 5px 12px 12px;
        padding: 8px 12px;
    }
    
    #search-input {
        padding: 10px 15px;
    }
    
    #order-history, #user-profile, #wishlist-container, #product-detail {
        padding: 8px;
    }
    
    .profile-card img {
        width: 100px;
        height: 100px;
    }
}

/* Order History */
.order-item {
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: var(--card-shadow);
}

.order-header {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.order-header h3 {
    margin: 0 0 5px;
    font-size: 16px;
}

.order-date {
    margin: 0;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

.order-status {
    font-size: 14px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
}

.order-content {
    padding: 10px 15px;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.order-total {
    font-weight: bold;
    margin: 0;
}

.reorder-btn {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

/* Loading spinner */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--tg-theme-hint-color);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--tg-theme-button-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

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

.error-container {
    padding: 20px;
    color: #d32f2f;
}

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
}

.no-products {
    text-align: center;
    padding: 40px 20px;
    color: var(--tg-theme-hint-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.no-products svg {
    stroke: var(--tg-theme-hint-color);
    opacity: 0.5;
    margin-bottom: 15px;
}

/* API Error message */
.api-error {
    text-align: center;
    padding: 40px 20px;
    color: #f44336;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.api-error svg {
    stroke: #f44336;
    opacity: 0.8;
    margin-bottom: 15px;
}

.retry-button {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    margin-top: 15px;
    cursor: pointer;
    font-weight: 500;
}

/* Enhanced Order History */
.section-title {
    font-size: 20px;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    margin: 5px 0 15px;
    color: var(--tg-theme-text-color);
    letter-spacing: var(--letter-spacing-tight);
}

.order-product {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 0;
}

.order-product-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
}

.order-product-details h4 {
    margin: 0 0 5px;
    font-size: 15px;
}

.order-product-details p {
    margin: 0;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

.order-status {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
}

.order-status.delivered {
    background-color: #4CAF50;
    color: white;
}

.order-status.processing {
    background-color: #FFC107;
    color: #333;
}

.order-status.cancelled {
    background-color: #F44336;
    color: white;
}

/* Order Summary in Profile */
.order-summary {
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 15px;
    box-shadow: var(--card-shadow);
}

.order-summary h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--tg-theme-text-color);
}

.order-summary p {
    margin: 8px 0;
    font-size: 16px;
}

.order-summary button {
    margin-top: 15px;
}

/* Flavor selection styling */
.flavor-selection {
    margin-bottom: 25px;
}

.flavor-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.flavor-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    width: calc(50% - 6px);
    background-color: white;
    position: relative;
}

.flavor-option.active {
    border-color: var(--color-3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.flavor-option.active::after {
    content: "";
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--color-3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
}

.flavor-option-image {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
}

.flavor-option-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flavor-option-info {
    flex: 1;
    overflow: hidden;
}

.flavor-option-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flavor-option .taste-badge {
    font-size: 12px;
    padding: 2px 8px;
    display: inline-block;
    margin: 0;
}

/* Taste badges for flavor indicators */
.taste-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
}

.sweet {
    background-color: rgba(255, 87, 34, 0.15);
    color: #e64a19;
}

.sour {
    background-color: rgba(255, 235, 59, 0.2);
    color: #f57f17;
}

.sweet-sour {
    background-color: rgba(255, 152, 0, 0.15);
    color: #ef6c00;
}

.cool {
    background-color: rgba(3, 169, 244, 0.15);
    color: #0277bd;
}

.rich {
    background-color: rgba(121, 85, 72, 0.15);
    color: #5d4037;
}

.spicy {
    background-color: rgba(244, 67, 54, 0.15);
    color: #d32f2f;
}

.neutral {
    background-color: rgba(158, 158, 158, 0.15);
    color: #616161;
}

/* Make flavor options stack on smaller screens */
@media (max-width: 480px) {
    .flavor-option {
        width: 100%;
    }
}

/* Flavor Dropdown Styling */
.flavor-dropdown-container {
    position: relative;
    margin-bottom: 15px;
}

.flavor-dropdown {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    background-color: white;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    color: var(--tg-theme-text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.flavor-dropdown:focus {
    outline: none;
    border-color: var(--color-3);
    box-shadow: 0 0 0 2px rgba(127, 153, 34, 0.2);
}

.dropdown-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--color-3);
}

.dropdown-icon svg {
    stroke: var(--color-4);
}

.selected-flavor-info {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

/* Cart/Wishlist headers */
.cart-header h2, .wishlist-header h2 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-tight);
}

/* Bottom navigation styles removed */

/* Font smoothing for better rendering */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Checkout Form Styling */
.checkout-form {
    padding: 10px 0;
}

.checkout-section {
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}

.checkout-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    color: var(--tg-theme-text-color);
    font-size: 18px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: var(--font-weight-medium);
    color: var(--tg-theme-text-color);
    font-size: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-3);
    box-shadow: 0 0 0 2px rgba(127, 153, 34, 0.15);
}

/* Delivery Method Toggle */
.delivery-toggle {
    display: flex;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    border-radius: 25px;
    overflow: hidden;
    padding: 4px;
    width: 100%;
}

.toggle-option {
    flex: 1;
    position: relative;
    text-align: center;
    cursor: pointer;
}

.toggle-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    display: block;
    padding: 10px;
    transition: all 0.2s ease;
    font-weight: var(--font-weight-medium);
    font-size: 15px;
    color: var(--tg-theme-hint-color);
    border-radius: 20px;
}

.toggle-option input:checked + .toggle-label {
    background-color: var(--color-1);
    color: var(--color-6);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Pickup Locations */
.pickup-locations-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pickup-location {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid var(--color-3);
    position: relative;
}

.pickup-location .location-name {
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    color: var(--tg-theme-text-color);
    display: block;
    margin-bottom: 5px;
}

.pickup-location p {
    margin: 5px 0;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

.pickup-location .location-hours {
    color: var(--color-3);
    font-weight: var(--font-weight-medium);
}

/* Confirmation page enhancements */
.confirmation-section {
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--card-shadow);
}

.confirmation-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
}

.confirmation-section p {
    margin: 5px 0;
    color: var(--tg-theme-text-color);
}

.pickup-note {
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 14px;
}

/* Helper class for hiding elements */
.hidden {
    display: none !important;
}

/* Pickup Locations - Updated for selection with centered right indicators */
.pickup-locations-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pickup-location {
    position: relative;
    cursor: pointer;
}

.pickup-location input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pickup-label {
    display: block;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    padding-right: 40px; /* Increase right padding to make room for the centered radio button */
    border-left: 4px solid rgba(127, 153, 34, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
}

.pickup-location input[type="radio"]:checked + .pickup-label {
    background-color: rgba(212, 225, 9, 0.1);
    border-left: 4px solid var(--color-3);
    box-shadow: 0 3px 10px rgba(127, 153, 34, 0.1);
}

.pickup-location input[type="radio"]:focus + .pickup-label {
    box-shadow: 0 0 0 2px rgba(127, 153, 34, 0.2);
}

/* Update radio button indicator position to be centered vertically on the right side */
.pickup-label::before {
    content: '';
    display: block;
    position: absolute;
    top: 50%; /* Center vertically */
    right: 15px; /* Position on right side */
    width: 20px;
    height: 20px;
    margin-top: -10px; /* Adjust for perfect vertical centering (half of height) */
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.pickup-location input[type="radio"]:checked + .pickup-label::before {
    background-color: var(--color-3);
    border-color: var(--color-3);
    box-shadow: inset 0 0 0 4px #f9f9f9;
}

.pickup-label .location-name {
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    color: var(--tg-theme-text-color);
    display: block;
    margin-bottom: 5px;
    padding-right: 0; /* Remove right padding since we moved the radio button */
}

/* Add styling for status history timeline */
.order-status-history {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0,0,0,0.1);
}

.order-status-history h4 {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: var(--font-weight-semibold);
}

.status-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.status-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e0e0e0;
}

.status-item {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    min-height: 20px;
}

.status-dot {
    position: absolute;
    left: 0;
    top: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #e0e0e0;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #e0e0e0;
    z-index: 1;
}

.status-dot.new {
    background-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3);
}

.status-dot.accepted {
    background-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.status-dot.processing {
    background-color: #FF9800;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.3);
}

.status-dot.delivering {
    background-color: #9C27B0;
    box-shadow: 0 0 0 2px rgba(156, 39, 176, 0.3);
}

.status-dot.completed {
    background-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.status-dot.rejected, .status-dot.cancelled {
    background-color: #F44336;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.3);
}

.status-name {
    font-weight: var(--font-weight-medium);
    margin: 0;
}

.status-time {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin: 2px 0 0 0;
}

/* Enhance the existing status indicator styles */
.order-status {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
    text-transform: capitalize;
}

/* Enhanced order status styling to make admin-set status more prominent */
.order-status {
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.order-status.new {
    background-color: #2196F3;
    color: white;
}

.order-status.accepted {
    background-color: #4CAF50;
    color: white;
}

.order-status.processing {
    background-color: #FF9800;
    color: #333;
}

.order-status.delivering, .order-status.out-for-delivery {
    background-color: #9C27B0;
    color: white;
}

.order-status.completed {
    background-color: #4CAF50;
    color: white;
}

.order-status.rejected, .order-status.cancelled {
    background-color: #F44336;
    color: white;
}

/* Add styling for delivery time info */
.delivery-time-info {
    margin: 10px 0;
    padding: 10px;
    background-color: rgba(33, 150, 243, 0.1);
    border-radius: 8px;
    border-left: 3px solid #2196F3;
}

.delivery-time-info p {
    margin: 0;
    font-size: 14px;
}

/* Fix visibility issues with text colors */
body.in-telegram {
    /* Ensure text is always visible regardless of theme */
    color: var(--tg-theme-text-color);
}

/* Force text contrast in various components */
.product-item p, 
.product-item h3, 
.product-detail p,
.product-detail h3,
.cart-item h4,
.cart-item p,
.form-group label,
.checkout-section h3 {
    color: var(--tg-theme-text-color);
}

.item-price, .status-time, .order-date {
    color: var(--tg-theme-hint-color);
}

/* Ensure good contrast on inputs */
#search-input,
.form-group input,
.form-group textarea,
.flavor-dropdown {
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    color: var(--tg-theme-text-color);
    border: 1px solid rgba(0,0,0,0.1);
}

/* Make bottom navigation match header */

/* Fix product detail background */
.product-detail-image {
    background-color: var(--tg-theme-secondary-bg-color, #f9f9f9);
}

/* Improve contrast for notification */
.notification {
    background-color: rgba(0,0,0,0.8);
    color: white;
}

/* Better card backgrounds for both light and dark themes */
.product-item,
.order-item,
.wishlist-item,
.cart-item,
.checkout-section,
.confirmation-section {
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    border: 1px solid rgba(127, 127, 127, 0.1);
}

/* Improve contrast for category filters */
.category-filter {
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    color: var(--tg-theme-text-color);
}

.category-filter.active {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

/* Обновленные стили для адаптивного окна проверки возраста */
.age-verification {
    background-color: rgba(0, 0, 0, 0.7);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.age-verification-dialog.telegram-themed {
    background-color: var(--tg-theme-secondary-bg-color, white);
    color: var(--tg-theme-text-color, black);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.age-verification-dialog h2 {
    margin-top: 0;
    color: var(--tg-theme-text-color, #333);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
}

.age-verification-dialog p {
    margin-bottom: 20px;
    color: var(--tg-theme-text-color, #333);
}

.age-verification-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.age-verification-buttons button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    font-size: 16px;
    font-family: var(--font-primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.age-verification-yes {
    background-color: var(--tg-theme-button-color, #4CAF50);
    color: var(--tg-theme-button-text-color, white);
    flex-grow: 1;
    max-width: 200px;
}

.age-verification-no {
    background-color: #f44336;
    color: white;
    flex-grow: 1;
    max-width: 200px;
}

.age-verification-buttons button:active {
    transform: scale(0.97);
}

/* Для мобильных устройств - вертикальное расположение кнопок */
@media (max-width: 480px) {
    .age-verification-buttons {
        flex-direction: column;
    }
    
    .age-verification-buttons button {
        max-width: none;
    }
}

/* Phone number validation styles */
.phone-format-hint {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.error-hint {
    color: #f44336;
}

.invalid-phone {
    border-color: #f44336 !important;
    background-color: rgba(244, 67, 54, 0.03);
}

.invalid-phone:focus {
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.15) !important;
}

/* Enhanced Telegram theme compatibility */
:root {
    /* Additional variables for better theme adaptation */
    --border-light: rgba(0,0,0,0.1);
    --border-dark: rgba(255,255,255,0.1);
    --shadow-light: 0 4px 8px rgba(0,0,0,0.08);
    --shadow-dark: 0 4px 8px rgba(0,0,0,0.2);
    --hover-light: rgba(0,0,0,0.05);
    --hover-dark: rgba(255,255,255,0.05);
    
    /* Adaptive borders and shadows based on theme */
    --adaptive-border: var(--border-light);
    --adaptive-shadow: var(--shadow-light);
    --adaptive-hover: var(--hover-light);
}

/* Apply different adaptive values for dark mode */
body.dark-mode {
    --adaptive-border: var(--border-dark);
    --adaptive-shadow: var(--shadow-dark);
    --adaptive-hover: var(--hover-dark);
}

/* Enhanced Pickup Locations Design - fully adaptive to Telegram themes */
.pickup-locations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    border-radius: 10px;
    background-color: var(--tg-theme-bg-color, rgba(0,0,0,0.03));
    padding: 15px;
}

/* Pickup location container - theme adaptive */
.pickup-location {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
}

.pickup-location:hover {
    transform: translateY(-2px);
    box-shadow: var(--adaptive-shadow);
}

/* Hide the actual radio button */
.pickup-location input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Pickup label styling with proper theme adaptation */
.pickup-label {
    display: flex;
    flex-direction: column;
    background-color: var(--tg-theme-secondary-bg-color, white);
    border-radius: 8px;
    padding: 15px 45px 15px 15px;
    border-left: 4px solid var(--color-3);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--adaptive-border);
}

/* Selected pickup location with better theme adaptation */
.pickup-location input[type="radio"]:checked + .pickup-label {
    background-color: var(--tg-theme-button-color, rgba(212, 225, 9, 0.1));
    border-left: 4px solid var(--color-3);
    box-shadow: 0 0 0 1px var(--color-3);
}

.pickup-location input[type="radio"]:focus + .pickup-label {
    box-shadow: 0 0 0 2px rgba(127, 153, 34, 0.2);
}

/* Radio button indicator with proper theme adaptation */
.pickup-label::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    border: 2px solid var(--tg-theme-hint-color, rgba(0,0,0,0.2));
    border-radius: 50%;
    background-color: var(--tg-theme-bg-color, white);
    transition: all 0.3s ease;
}

/* Selected state for the indicator */
.pickup-location input[type="radio"]:checked + .pickup-label::before {
    border-color: transparent;
    background-color: var(--tg-theme-button-color, var(--color-3));
}

/* Inner dot for selected radio - theme adaptive */
.pickup-location input[type="radio"]:checked + .pickup-label::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    margin-right: 6px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Improve contrast for pickup location text elements */
.pickup-label .location-name {
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    color: var(--tg-theme-text-color);
    display: block;
    margin-bottom: 6px;
}

.pickup-label p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    line-height: 1.4;
}

.pickup-label .location-hours {
    margin-top: 6px;
    color: var(--color-3);
    font-weight: var(--font-weight-medium);
    font-size: 13px;
}

/* Fully adaptive header for pickup section */
#pickup-locations h4 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    margin: 10px 0 15px 0;
    color: var(--tg-theme-text-color);
}

/* Enhanced Pickup Locations Design with better theme adaptation */
.pickup-locations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    border-radius: 10px;
    background-color: rgba(var(--tg-theme-bg-color, 0,0,0), 0.03);
    padding: 15px;
}

/* Pickup location container with better theming */
.pickup-location {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
}

.pickup-location:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* Hide the actual radio button */
.pickup-location input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Pickup label styling with better theming */
.pickup-label {
    display: flex;
    flex-direction: column;
    background-color: var(--tg-theme-secondary-bg-color, white);
    border-radius: 8px;
    padding: 15px 45px 15px 15px; 
    border-left: 4px solid rgba(127, 153, 34, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--adaptive-border);
}

/* Selected pickup location with theme-aware styling */
.pickup-location input[type="radio"]:checked + .pickup-label {
    background-color: rgba(var(--tg-theme-button-color, 212, 225, 9), 0.1);
    border-left: 4px solid var(--color-3);
    box-shadow: 0 3px 10px rgba(127, 153, 34, 0.1);
}

.pickup-location input[type="radio"]:focus + .pickup-label {
    box-shadow: 0 0 0 2px rgba(127, 153, 34, 0.2);
}

/* Radio button indicator with improved contrast */
.pickup-label::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    border: 2px solid var(--tg-theme-hint-color, rgba(0,0,0,0.2));
    border-radius: 50%;
    background-color: var(--tg-theme-bg-color, white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

/* Selected radio indicator with better emphasis */
.pickup-location input[type="radio"]:checked + .pickup-label::before {
    border-color: var(--color-3);
    border-width: 2px;
}

/* Inner dot for selected radio with theme awareness */
.pickup-location input[type="radio"]:checked + .pickup-label::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    margin-right: 5px;
    background-color: var(--color-3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Improve text contrast for location names */
.pickup-label .location-name {
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    color: var(--tg-theme-text-color);
    display: block;
    margin-bottom: 6px;
}

/* Better styling for location address with theme-aware colors */
.pickup-label p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    line-height: 1.4;
}

/* Working hours styling with brand color that works across themes */
.pickup-label .location-hours {
    margin-top: 6px;
    color: var(--color-3);
    font-weight: var(--font-weight-medium);
    font-size: 13px;
}

/* Better header styling with theme awareness */
#pickup-locations h4 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    margin: 10px 0 15px 0;
    color: var(--tg-theme-text-color);
}

/* Global improvements for theme compatibility */
button, .button, .checkout-btn {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

input, textarea, select {
    background-color: var(--tg-theme-secondary-bg-color, white);
    color: var(--tg-theme-text-color);
    border-color: var(--adaptive-border);
}

.card, .checkout-section, .confirmation-section, .product-item, .wishlist-item, .cart-item {
    background-color: var(--tg-theme-secondary-bg-color, white);
    border-color: var(--adaptive-border);
    box-shadow: var(--adaptive-shadow);
}

/* Enhanced component hover states for better feedback across themes */
.pickup-location:hover .pickup-label,
.product-item:hover,
.wishlist-item:hover,
.icon-button:hover {
    background-color: var(--adaptive-hover);
}

/* Fixed Pickup Locations - resolved duplicate circles and improved theme adaptation */
.pickup-locations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    border-radius: 10px;
    background-color: rgba(var(--tg-theme-bg-color-rgb, 0,0,0), 0.03);
    padding: 15px;
}

/* Reset all previous pickup location styling to avoid conflicts */
.pickup-location {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
    background-color: transparent;
    padding: 0;
    border: none;
}

.pickup-location:hover {
    transform: translateY(-2px);
    box-shadow: var(--adaptive-shadow);
}

/* Hide the actual radio button */
.pickup-location input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Simplified pickup label styling */
.pickup-label {
    display: flex;
    flex-direction: column;
    background-color: var(--tg-theme-secondary-bg-color, white);
    border-radius: 8px;
    padding: 15px 45px 15px 15px; /* Right padding for radio circle */
    border-left: 4px solid rgba(127, 153, 34, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--adaptive-border);
}

/* Selected pickup location styling */
.pickup-location input[type="radio"]:checked + .pickup-label {
    background-color: rgba(var(--tg-theme-button-color-rgb, 212, 225, 9), 0.1);
    border-left: 4px solid var(--color-3);
    box-shadow: 0 0 0 1px var(--color-3);
}

.pickup-location input[type="radio"]:focus + .pickup-label {
    box-shadow: 0 0 0 2px rgba(127, 153, 34, 0.2);
}

/* IMPORTANT: Remove all previous ::before and ::after styles first */
.pickup-label::before, 
.pickup-label::after,
.pickup-location input[type="radio"]:checked + .pickup-label::before,
.pickup-location input[type="radio"]:checked + .pickup-label::after {
    content: none;
    display: none;
}

/* Now add a single clean radio button indicator */
.pickup-label .radio-indicator {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 2px solid var(--tg-theme-hint-color, rgba(0,0,0,0.2));
    border-radius: 50%;
    background-color: var(--tg-theme-bg-color, white);
    transition: all 0.3s ease;
}

/* Selected state for the indicator */
.pickup-location input[type="radio"]:checked + .pickup-label .radio-indicator {
    border-color: var(--color-3);
    background-color: var(--tg-theme-button-color, var(--color-3));
}

/* Inner dot for selected radio */
.pickup-location input[type="radio"]:checked + .pickup-label .radio-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 50%;
}

/* Text styling for pickup details */
.pickup-label .location-name {
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    color: var(--tg-theme-text-color);
    display: block;
    margin-bottom: 6px;
}

.pickup-label p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    line-height: 1.4;
}

.pickup-label .location-hours {
    margin-top: 6px;
    color: var(--color-3);
    font-weight: var(--font-weight-medium);
    font-size: 13px;
}

/* Unified Back Button Design */
.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    color: var(--tg-theme-text-color);
}

.back-button:hover {
    background-color: var(--adaptive-hover);
}

.back-button:active {
    transform: scale(0.95);
}

.back-button svg {
    width: 24px;
    height: 24px;
    stroke: var(--tg-theme-text-color);
    stroke-width: 2px;
}

/* Remove text from back buttons, keep only consistent icons */
.back-to-products,
.back-to-cart,
.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    color: var(--tg-theme-text-color);
}

/* Updated header with unified back button */
.cart-header,
.wishlist-header,
.product-detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
}

.cart-header h2,
.wishlist-header h2,
.product-detail-header h2 {
    margin: 0;
    text-align: center;
    flex-grow: 1;
    font-size: 18px;
}

/* Improved Wishlist button in header - no outline and better contrast across themes */
#wishlist-button {
    position: relative;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

#wishlist-button svg {
    position: relative;
    z-index: 0;
    width: 24px;
    height: 24px;
    stroke: var(--tg-theme-hint-color);
    stroke-width: 1.5px;
    fill: transparent;
    transition: all 0.3s ease;
}

#wishlist-button.has-items svg {
    fill: #ff5252;
    stroke: #ff5252;
    stroke-opacity: 0;
    stroke-width: 0;
}

/* When not filled (empty wishlist) - make outline more visible */
#wishlist-button:not(.has-items) svg {
    stroke: var(--tg-theme-hint-color);
    stroke-width: 1.5px;
}

/* Enhanced hover effect */
#wishlist-button:hover {
    transform: translateY(-2px);
    background-color: transparent;
}

#wishlist-button:not(.has-items):hover svg {
    stroke: var(--tg-theme-text-color);
}

#wishlist-button.has-items:hover svg {
    fill: #ff3a3a;
}

/* Revised styling for wishlist count badge */
#wishlist-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}



/* Revised styling for wishlist count badge to work with consistent icon size */
#wishlist-count {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 16px;
    height: 16px;
    background-color: #ff5252;
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 2;
    transform: translate(25%, -25%);
}

/* Remove any remaining outline settings from other rules */
.icon-button#wishlist-button {
    overflow: visible;
    box-shadow: none;
    border: none;
    background-color: transparent;
    width: 42px;
    height: 42px;
}

/* Override hover behavior to avoid scaling issues */
#wishlist-button:hover {
    transform: none;
    background-color: rgba(0,0,0,0.06);
}

#wishlist-button:hover svg {
    transform: scale(1.1);
}

/* Ensure the heart icon works consistently across all Telegram color schemes */
.dark-mode #wishlist-button svg {
    stroke: var(--tg-theme-hint-color, #aaaaaa);
}

.light-mode #wishlist-button svg {
    stroke: var(--tg-theme-hint-color, #999999);
}

/* Remove old wishlist indicator styles that might interfere */
#wishlist-button.has-items:after,
.icon-button#wishlist-button.has-items:after {
    content: none;
    display: none;
}

/* Promo Code Styling */
.promo-code-container {
    margin: 15px 0;
    padding: 10px 0;
}

.promo-input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin-bottom: 10px;
    overflow: hidden; /* Prevent content from spilling out */
    position: relative; /* Establish positioning context */
}

.promo-input-group input {
    flex: 1;
    height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    min-width: 0; /* Fix for flexbox child min-width issue */
}

.apply-promo-btn {
    height: 42px;
    min-width: 100px; /* Ensure button has minimum width */
    width: auto; /* Allow button to size based on content */
    white-space: nowrap; /* Prevent text wrapping */
    background-color: var(--tg-theme-button-color, var(--color-1));
    color: var(--tg-theme-button-text-color, var(--color-6));
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 0 15px;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    flex-shrink: 0; /* Prevent button from shrinking */
}

/* Fix for Telegram WebApp specific issues */
body.in-telegram .promo-input-group {
    max-width: 100%;
    margin-right: 0;
}

body.in-telegram .apply-promo-btn {
    position: relative;
    right: 0;
}

.promo-message {
    margin-top: 8px;
    font-size: 14px;
}

.promo-message.success {
    color: #4CAF50;
}

.promo-message.error {
    color: #F44336;
}

.promo-discount {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
    border-radius: 4px;
}

.promo-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background-color: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    margin-bottom: 10px;
}

/* Enhanced Pickup Locations Design with better theme adaptation */
.pickup-locations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    border-radius: 10px;
    background-color: rgba(var(--tg-theme-bg-color, 0,0,0), 0.03);
    padding: 15px;
}

/* Pickup location container with better theming */
.pickup-location {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
}

.pickup-location:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* Hide the actual radio button */
.pickup-location input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Pickup label styling with better theming */
.pickup-label {
    display: flex;
    flex-direction: column;
    background-color: var(--tg-theme-secondary-bg-color, white);
    border-radius: 8px;
    padding: 15px 45px 15px 15px; 
    border-left: 4px solid rgba(127, 153, 34, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--adaptive-border);
}

/* Selected pickup location with theme-aware styling */
.pickup-location input[type="radio"]:checked + .pickup-label {
    background-color: rgba(var(--tg-theme-button-color, 212, 225, 9), 0.1);
    border-left: 4px solid var(--color-3);
    box-shadow: 0 3px 10px rgba(127, 153, 34, 0.1);
}

.pickup-location input[type="radio"]:focus + .pickup-label {
    box-shadow: 0 0 0 2px rgba(127, 153, 34, 0.2);
}

/* Radio button indicator with improved contrast */
.pickup-label::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    border: 2px solid var(--tg-theme-hint-color, rgba(0,0,0,0.2));
    border-radius: 50%;
    background-color: var(--tg-theme-bg-color, white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

/* Selected radio indicator with better emphasis */
.pickup-location input[type="radio"]:checked + .pickup-label::before {
    border-color: var(--color-3);
    border-width: 2px;
}

/* Inner dot for selected radio with theme awareness */
.pickup-location input[type="radio"]:checked + .pickup-label::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    margin-right: 5px;
    background-color: var(--color-3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Improve text contrast for location names */
.pickup-label .location-name {
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    color: var(--tg-theme-text-color);
    display: block;
    margin-bottom: 6px;
}

/* Better styling for location address with theme-aware colors */
.pickup-label p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    line-height: 1.4;
}

/* Working hours styling with brand color that works across themes */
.pickup-label .location-hours {
    margin-top: 6px;
    color: var(--color-3);
    font-weight: var(--font-weight-medium);
    font-size: 13px;
}

/* Better header styling with theme awareness */
#pickup-locations h4 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    margin: 10px 0 15px 0;
    color: var(--tg-theme-text-color);
}

/* Global improvements for theme compatibility */
button, .button, .checkout-btn {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

input, textarea, select {
    background-color: var(--tg-theme-secondary-bg-color, white);
    color: var(--tg-theme-text-color);
    border-color: var(--adaptive-border);
}

.card, .checkout-section, .confirmation-section, .product-item, .wishlist-item, .cart-item {
    background-color: var(--tg-theme-secondary-bg-color, white);
    border-color: var(--adaptive-border);
    box-shadow: var(--adaptive-shadow);
}

/* Enhanced component hover states for better feedback across themes */
.pickup-location:hover .pickup-label,
.product-item:hover,
.wishlist-item:hover,
.icon-button:hover {
    background-color: var(--adaptive-hover);
}

/* Fixed Pickup Locations - resolved duplicate circles and improved theme adaptation */
.pickup-locations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    border-radius: 10px;
    background-color: rgba(var(--tg-theme-bg-color-rgb, 0,0,0), 0.03);
    padding: 15px;
}

/* Reset all previous pickup location styling to avoid conflicts */
.pickup-location {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
    background-color: transparent;
    padding: 0;
    border: none;
}

.pickup-location:hover {
    transform: translateY(-2px);
    box-shadow: var(--adaptive-shadow);
}

/* Hide the actual radio button */
.pickup-location input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Simplified pickup label styling */
.pickup-label {
    display: flex;
    flex-direction: column;
    background-color: var(--tg-theme-secondary-bg-color, white);
    border-radius: 8px;
    padding: 15px 45px 15px 15px; /* Right padding for radio circle */
    border-left: 4px solid rgba(127, 153, 34, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--adaptive-border);
}

/* Selected pickup location styling */
.pickup-location input[type="radio"]:checked + .pickup-label {
    background-color: rgba(var(--tg-theme-button-color-rgb, 212, 225, 9), 0.1);
    border-left: 4px solid var(--color-3);
    box-shadow: 0 0 0 1px var(--color-3);
}

.pickup-location input[type="radio"]:focus + .pickup-label {
    box-shadow: 0 0 0 2px rgba(127, 153, 34, 0.2);
}

/* IMPORTANT: Remove all previous ::before and ::after styles first */
.pickup-label::before, 
.pickup-label::after,
.pickup-location input[type="radio"]:checked + .pickup-label::before,
.pickup-location input[type="radio"]:checked + .pickup-label::after {
    content: none;
    display: none;
}

/* Now add a single clean radio button indicator */
.pickup-label .radio-indicator {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 2px solid var(--tg-theme-hint-color, rgba(0,0,0,0.2));
    border-radius: 50%;
    background-color: var(--tg-theme-bg-color, white);
    transition: all 0.3s ease;
}

/* Selected state for the indicator */
.pickup-location input[type="radio"]:checked + .pickup-label .radio-indicator {
    border-color: var(--color-3);
    background-color: var(--tg-theme-button-color, var(--color-3));
}

/* Inner dot for selected radio */
.pickup-location input[type="radio"]:checked + .pickup-label .radio-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 50%;
}

/* Text styling for pickup details */
.pickup-label .location-name {
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    color: var(--tg-theme-text-color);
    display: block;
    margin-bottom: 6px;
}

.pickup-label p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    line-height: 1.4;
}

.pickup-label .location-hours {
    margin-top: 6px;
    color: var(--color-3);
    font-weight: var(--font-weight-medium);
    font-size: 13px;
}

/* Unified Back Button Design */
.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    color: var(--tg-theme-text-color);
}

.back-button:hover {
    background-color: var(--adaptive-hover);
}

.back-button:active {
    transform: scale(0.95);
}

.back-button svg {
    width: 24px;
    height: 24px;
    stroke: var(--tg-theme-text-color);
    stroke-width: 2px;
}

/* Remove text from back buttons, keep only consistent icons */
.back-to-products,
.back-to-cart,
.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    color: var(--tg-theme-text-color);
}

/* Updated header with unified back button */
.cart-header,
.wishlist-header,
.product-detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
}

.cart-header h2,
.wishlist-header h2,
.product-detail-header h2 {
    margin: 0;
    text-align: center;
    flex-grow: 1;
    font-size: 18px;
}

/* Improved Wishlist button in header - no outline and better contrast across themes */
#wishlist-button {
    position: relative;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

#wishlist-button svg {
    position: relative;
    z-index: 0;
    width: 24px;
    height: 24px;
    stroke: var(--tg-theme-hint-color);
    stroke-width: 1.5px;
    fill: transparent;
    transition: all 0.3s ease;
}

#wishlist-button.has-items svg {
    fill: #ff5252;
    stroke: #ff5252;
    stroke-opacity: 0;
    stroke-width: 0;
}

/* When not filled (empty wishlist) - make outline more visible */
#wishlist-button:not(.has-items) svg {
    stroke: var(--tg-theme-hint-color);
    stroke-width: 1.5px;
}

/* Enhanced hover effect */
#wishlist-button:hover {
    transform: translateY(-2px);
    background-color: transparent;
}

#wishlist-button:not(.has-items):hover svg {
    stroke: var(--tg-theme-text-color);
}

#wishlist-button.has-items:hover svg {
    fill: #ff3a3a;
}

/* Revised styling for wishlist count badge */
#wishlist-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}



/* When filled (has items) - maintain proper sizing */
#wishlist-button.has-items svg {
    fill: #ff5252;
    stroke: #ff5252;
    stroke-opacity: 0;
    stroke-width: 0;
    width: 24px !important;
    height: 24px !important;
}

/* Fix for specific Telegram themes that might scale SVGs differently */
body.in-telegram #wishlist-button svg {
    transform: scale(1);
    width: 24px !important;
    height: 24px !important;
}

/* Revised styling for wishlist count badge to work with consistent icon size */
#wishlist-count {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 16px;
    height: 16px;
    background-color: #ff5252;
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 2;
    transform: translate(25%, -25%);
}

/* Remove any remaining outline settings from other rules */
.icon-button#wishlist-button {
    overflow: visible;
    box-shadow: none;
    border: none;
    background-color: transparent;
    width: 42px;
    height: 42px;
}

/* Override hover behavior to avoid scaling issues */
#wishlist-button:hover {
    transform: none;
    background-color: rgba(0,0,0,0.06);
}

#wishlist-button:hover svg {
    transform: scale(1.1);
}

/* Ensure the heart icon works consistently across all Telegram color schemes */
.dark-mode #wishlist-button svg {
    stroke: var(--tg-theme-hint-color, #aaaaaa);
}

.light-mode #wishlist-button svg {
    stroke: var(--tg-theme-hint-color, #999999);
}

/* Remove old wishlist indicator styles that might interfere */
#wishlist-button.has-items:after,
.icon-button#wishlist-button.has-items:after {
    content: none;
    display: none;
}

/* Promo Code Styling */
.promo-code-container {
    margin: 15px 0;
    padding: 10px 0;
}

.promo-input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin-bottom: 10px;
    overflow: hidden; /* Prevent content from spilling out */
    position: relative; /* Establish positioning context */
}

.promo-input-group input {
    flex: 1;
    height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    min-width: 0; /* Fix for flexbox child min-width issue */
}

.apply-promo-btn {
    height: 42px;
    min-width: 100px; /* Ensure button has minimum width */
    width: auto; /* Allow button to size based on content */
    white-space: nowrap; /* Prevent text wrapping */
    background-color: var(--tg-theme-button-color, var(--color-1));
    color: var(--tg-theme-button-text-color, var(--color-6));
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 0 15px;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    flex-shrink: 0; /* Prevent button from shrinking */
}

/* Fix for Telegram WebApp specific issues */
body.in-telegram .promo-input-group {
    max-width: 100%;
    margin-right: 0;
}

body.in-telegram .apply-promo-btn {
    position: relative;
    right: 0;
}

.promo-message {
    margin-top: 8px;
    font-size: 14px;
}

.promo-message.success {
    color: #4CAF50;
}

.promo-message.error {
    color: #F44336;
}

.promo-discount {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
    border-radius: 4px;
}

.promo-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background-color: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    margin-bottom: 10px;
}

/* Улучшенные стили для секции выбора времени */
.checkout-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkout-section h3:has(+ #pickup-time-selection),
.checkout-section h3:has(+ #delivery-time-selection) {
    position: relative;
}

.checkout-section h3:has(+ #pickup-time-selection)::before,
.checkout-section h3:has(+ #delivery-time-selection)::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%237f9922' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 5px;
}

/* Стилизованный выпадающий список для времени */
.time-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 12px 15px;
    padding-right: 40px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%237f9922' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

.time-select:focus {
    outline: none;
    border-color: var(--color-3);
    box-shadow: 0 0 0 2px rgba(127, 153, 34, 0.15);
}

/* Стилизация опций внутри селекта */
.time-select option {
    padding: 10px;
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
}

/* Стилизация ввода времени */
input[type="time"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 12px 15px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    width: 100%;
    transition: all 0.2s ease;
}

input[type="time"]:focus {
    outline: none;
    border-color: var(--color-3);
    box-shadow: 0 0 0 2px rgba(127, 153, 34, 0.15);
}

/* Стилизованные плитки с вариантами времени */
.time-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.time-option {
    position: relative;
    overflow: hidden;
}

.time-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.time-option-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 15px;
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.time-option-label .time-icon {
    margin-bottom: 8px;
    color: var(--color-3);
}

.time-option-label .time-name {
    font-weight: var(--font-weight-medium);
    font-size: 15px;
    margin-bottom: 4px;
}

.time-option-label .time-range {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #999);
}

.time-option input[type="radio"]:checked + .time-option-label {
    background-color: rgba(var(--tg-theme-button-color-rgb, 212, 225, 9), 0.1);
    border-color: var(--color-3);
    box-shadow: 0 2px 8px rgba(127, 153, 34, 0.15);
}

.time-option input[type="radio"]:focus + .time-option-label {
    box-shadow: 0 0 0 2px rgba(127, 153, 34, 0.2);
}

/* Информационная подсказка о времени работы */
.time-info-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    margin-top: 15px;
    background-color: rgba(var(--tg-theme-bg-color-rgb, 245, 245, 245), 0.5);
    border-left: 3px solid var(--color-3);
    border-radius: 4px;
}

.time-info-tip .tip-icon {
    color: var(--color-3);
    flex-shrink: 0;
}

.time-info-tip p {
    margin: 0;
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999);
}

/* Контейнер пользовательского времени */
#custom-pickup-time, 
#custom-delivery-time {
    padding: 15px;
    background-color: rgba(var(--tg-theme-bg-color-rgb, 245, 245, 245), 0.5);
    border-radius: 8px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

#custom-pickup-time.hidden, 
#custom-delivery-time.hidden {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

#custom-pickup-time label, 
#custom-delivery-time label {
    display: block;
    margin-bottom: 8px;
    color: var(--tg-theme-text-color, #000000);
    font-weight: var(--font-weight-medium);
}

/* Анимация для опций времени */
@keyframes timeOptionAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.time-option {
    animation: timeOptionAppear 0.3s ease forwards;
    animation-delay: calc(var(--item-index, 0) * 0.05s);
    opacity: 0;
}

/* Респонсивность для мобильных устройств */
@media (max-width: 480px) {
    .time-options {
        grid-template-columns: 1fr;
    }
}

/* Time Range Inputs Styling */
.time-range-inputs {
    display: flex;
    gap: 10px;
}

.time-range-inputs > div {
    flex: 1;
}

.time-range-inputs label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--tg-theme-hint-color, #666);
}

.time-range-inputs input[type="time"] {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--tg-theme-secondary-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
}

/* Enhance time section info tips */
.time-info-tip {
    margin-top: 10px;
    background-color: rgba(33, 150, 243, 0.05);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.time-info-tip .tip-icon {
    flex-shrink: 0;
    color: #2196F3;
}

.time-info-tip p {
    margin: 0;
    font-size: 13px;
    color: var(--tg-theme-hint-color, #666);
    line-height: 1.4;
}

/* Add responsive adjustments for smaller screens */
@media (max-width: 480px) {
    .time-range-inputs {
        flex-direction: column;
        gap: 15px;
    }
    
    #custom-pickup-time, 
    #custom-delivery-time {
        padding: 12px;
    }
    
    .time-select {
        font-size: 15px;
    }
}

/* Transition for custom time sections */
#custom-pickup-time, 
#custom-delivery-time {
    max-height: 200px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

#custom-pickup-time.hidden, 
#custom-delivery-time.hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    overflow: hidden;
}

/* Fix text contrast issues in dark theme */
.cart-header h2, 
.checkout-form h2,
.section-title,
.checkout-section h3,
.confirmation-section h3 {
    color: var(--tg-theme-text-color) !important; /* Force proper text color */
    font-weight: var(--font-weight-bold);
}

/* Ensure back arrow is visible in dark theme */
.back-button svg,
.back-to-products svg,
.back-to-cart svg {
    stroke: var(--tg-theme-text-color) !important;
    stroke-width: 2.5px; /* Make slightly thicker for better visibility */
}

/* Extra visibility for dark theme specifically */
body.dark-mode .cart-header h2,
body.dark-mode .checkout-form h2,
body.dark-mode .section-title,
body.dark-mode .checkout-section h3 {
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

body.dark-mode .back-button svg,
body.dark-mode .back-to-products svg,
body.dark-mode .back-to-cart svg {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

/* Make button text visible in dark theme */
.checkout-btn, 
.continue-btn {
    color: var(--tg-theme-button-text-color) !important;
    font-weight: var(--font-weight-semibold);
}

/* Ensure cart total rows are visible */
.cart-total-row {
    color: var(--tg-theme-text-color) !important;
    font-weight: var(--font-weight-medium);
}

/* Fix specific text contrast issues in dark theme for cart and checkout */
.cart-header h2,
.checkout-form h2,
.cart-header .back-to-products svg,
.back-to-cart svg,
.back-button svg {
    color: var(--color-1) !important; /* Use brand yellow color for better visibility */
    fill: var(--color-1) !important;
    stroke: var(--color-1) !important;
    stroke-width: 2.5px !important;
}

/* Make checkout heading more visible */
.checkout-form h2,
h2:contains("Оформление заказа"),
h2:contains("Ваша корзина") {
    color: #000000 !important; /* Force black text */
    font-size: 22px !important;
    font-weight: 700 !important;
    text-shadow: none !important; /* Remove any text shadow */
    letter-spacing: 0.5px !important;
}

/* Override any other styling that might be applied to these specific headings */
.cart-header h2 {
    color: #000000 !important;
}

/* Add a subtle glow to these elements in dark theme for extra visibility */
body.dark-mode .cart-header h2,
body.dark-mode .checkout-form h2,
body.dark-mode .back-button svg,
body.dark-mode .back-to-products svg, 
body.dark-mode .back-to-cart svg {
    filter: drop-shadow(0 0 2px rgba(212, 225, 9, 0.5)) !important;
}

/* Стилі для відображення смаків */
.flavor-label {
    color: var(--tg-theme-hint-color, #999);
    font-weight: normal;
}

.flavor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 5px 0 8px;
}

.flavor-tag {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    color: var(--tg-theme-text-color, #000);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    margin: 2px;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-in;
}

.dark-mode .flavor-tag {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--tg-theme-text-color, #fff);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.flavor-icon {
    margin-right: 4px;
    font-size: 0.75rem;
}

/* Для підрахунку кількості смаків */
.flavor-quantity {
    background-color: rgba(0, 123, 255, 0.8);
    color: white;
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    height: 1.2rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dark-mode .flavor-quantity {
    background-color: rgba(0, 123, 255, 0.9);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Адаптивні стилі для смаків на мобільних пристроях */
@media (max-width: 768px) {
    .flavor-tag {
        font-size: 0.75rem;
        padding: 3px 8px;
        max-width: 150px;
    }
    
    .flavor-list {
        gap: 3px;
        margin: 3px 0 6px;
    }
    
    .flavor-quantity {
        font-size: 0.65rem;
        min-width: 1rem;
        height: 1rem;
    }
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: translateY(5px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}
