:root {
    --primary-color: #8b2f4a;
    --secondary-color: #6d2439;
    --background-color: #f9f9f9;
    --card-background: rgba(245, 181, 200, 0.08);
    --text-color: #333333;
    --border-color: #e0e0e0;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shopping-icon {
    cursor: pointer;
    color: var(--text-color);
    position: relative;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.cart-count.has-items {
    opacity: 1;
    transform: scale(1);
}

.logo img {
    height: 45px;
    width: auto;
}

/* Banner Carousel Styles */
.banner-carousel {
    margin: 30px 0;
    border-radius: 20px;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 20%;
}

.carousel-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.dot.active {
    background-color: white;
}

/* Products Section */
.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 100px;
}

.product-card {
    /* Controlled from admin Style tab via --card-background, with pink fallback */
    background: var(--card-background, rgba(245, 181, 200, 0.08));
    border-radius: 15px;
    padding: 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 380px;
    box-sizing: border-box;
}

.product-image {
    position: relative;
    height: 300px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
    z-index: 3;
}

.product-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.badge-new {
    background: rgba(30, 136, 229, 0.9);
    color: #fff;
}

.badge-soldout {
    background: rgba(211, 47, 47, 0.9);
    color: #fff;
}

.badge-discount {
    background: rgba(46, 125, 50, 0.9);
    color: #fff;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.geometric-pattern {
    display: none;
}

.product-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
    margin-top: 10px;
    line-height: 1.4;
    display: block;
    padding: 0 10px;
}

.product-price {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 0 10px;
    margin-bottom: 12px;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-color);
    font-size: 14px;
    white-space: nowrap;
    opacity: 0.7;
}

.new-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.add-to-cart {
    background-color: var(--primary-color);
    color: white;
    border: none;
    margin: 0 10px 10px 10px;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 48px;
    width: calc(100% - 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.add-to-cart.sold-out {
    background-color: #d0d0d0;
    color: #555;
    cursor: not-allowed;
    border: 1px solid #c3c3c3;
}

.add-to-cart:hover {
    background-color: var(--secondary-color);
}

.add-to-cart.has-quantity {
    gap: 15px;
    padding: 12px 30px;
    background-color: rgba(245, 181, 200, 0.2);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.qty-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 30px;
    text-align: center;
    line-height: 1;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-arrow {
    font-size: 16px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    user-select: none;
    line-height: 1;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-arrow:hover {
    transform: scale(1.3);
    color: var(--secondary-color);
}

.qty-arrow:active {
    transform: scale(1.1);
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 18px 25px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 10000;
    animation: slideInDown 0.4s ease-out, fadeOutUp 0.3s ease-in 2.7s;
    width: 90%;
    max-width: 600px;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    text-align: center;
}

.toast-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 5px;
}

.toast-message {
    font-size: 14px;
    opacity: 0.95;
}

@keyframes slideInDown {
    from {
        transform: translate(-50%, -100px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes fadeOutUp {
    to {
        opacity: 0;
        transform: translate(-50%, -100px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo img {
        height: 32px;
    }
    
    .carousel-container {
        padding-bottom: 50%;
    }

    .banner-content {
        flex-direction: column;
        gap: 30px;
    }

    .big-number {
        font-size: 120px;
    }

    .off-text {
        font-size: 32px;
        margin-top: 60px;
    }

    .banner-right h2,
    .banner-right h3 {
        font-size: 32px;
    }

    .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-card {
        padding: 5px;
        height: auto;
    }
    
    .product-image {
        height: 210px;
    }
    
    .product-title {
        padding: 12px 0 0 0;
        font-size: 15px;
    }
    
    .product-price {
        padding: 0;
        margin-bottom: 12px;
        font-size: 13px;
    }
    
    .add-to-cart {
        padding: 12px 20px;
        width: auto;
        margin: 0;
        white-space: nowrap;
        font-size: 13px;
    }
}

/* Cart Modal */
.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.cart-modal.active {
    display: flex;
}

.cart-modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    border-bottom: 2px solid var(--border-color);
}

.cart-header h2 {
    font-size: 20px;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
}

.close-modal {
    font-size: 35px;
    color: var(--text-color);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
    opacity: 0.6;
}

.close-modal:hover {
    color: var(--primary-color);
    opacity: 1;
}

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

.empty-cart {
    text-align: center;
    color: var(--text-color);
    font-size: 18px;
    padding: 40px;
    opacity: 0.6;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.cart-item-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-image-container h4 {
    font-size: 14px;
    color: var(--text-color);
    margin: 0;
    text-align: center;
    max-width: 80px;
    line-height: 1.3;
}

.cart-item-details {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-color);
}

.qty-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.cart-item-total {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
}

.remove-item {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 5px;
    transition: color 0.3s;
    opacity: 0.5;
}

.remove-item:hover {
    color: #e74c3c;
    opacity: 1;
}

.cart-options {
    padding: 8px 15px;
    background: var(--background-color);
    border-top: 1px solid var(--border-color);
    font-size: 15px;
    direction: rtl;
    text-align: right;
    line-height: 1.6;
}

.shipping-options,
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shipping-option,
.payment-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-color);
}

.payment-option {
    cursor: default; /* fixed checkbox */
}

.shipping-option input,
.payment-option input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.payment-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' 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-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
}

.option-text {
    flex: 1;
}

.cart-footer {
    padding: 6px 15px;
    border-top: 1px solid var(--border-color);
    background: var(--background-color);
}

.cart-totals-wrapper {
    margin-bottom: 3px;
}

.cart-subtotal-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 1px;
    padding: 1px 0;
}

.cart-subtotal-row.has-discount span:last-child {
    color: #e53935;
    font-weight: 700;
}

.cart-subtotal-row.has-discount #cartSubtotal {
    text-decoration: line-through;
}

.cart-shipping-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 1px;
    padding: 1px 0;
}

.cart-shipping-row.free-shipping {
    color: #0056b3;
    font-weight: 700;
}

.cart-discount-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: #28a745;
    margin-bottom: 2px;
    padding: 2px 6px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 5px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 6px;
    padding-top: 4px;
    border-top: 2px solid var(--border-color);
}

.cart-discount {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: #0d6efd;
    margin-bottom: 6px;
}

.checkout-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.checkout-btn:hover {
    background-color: var(--secondary-color);
}

/* Checkout Form */
.checkout-form {
    padding: 10px 15px;
    border-top: 1px solid var(--border-color);
    background: var(--background-color);
}

.checkout-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 5px;
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea {
    width: 100%;
    padding: 6px 8px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: var(--text-color);
}

.checkout-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 8px center;
    background-size: 12px;
    padding-left: 28px;
    appearance: none;
    -webkit-appearance: none;
}

#custPhone {
    direction: rtl;
    text-align: right;
}

.checkout-form input:focus,
.checkout-form select:focus,
.checkout-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(139, 47, 74, 0.12);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.form-row-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
}

.footer-actions {
    display: flex;
    gap: 8px;
}

.back-btn {
    background: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.back-btn:hover {
    background: rgba(245, 181, 200, 0.2);
}

@media (max-width: 768px) {
    .cart-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .cart-item {
        flex-wrap: wrap;
    }
    
    .cart-item img {
        width: 60px;
        height: 60px;
    }

    .checkout-form input,
    .checkout-form select,
    .checkout-form textarea {
        padding: 12px 14px;
        font-size: 15px;
    }
}
/* Product Details Modal */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.product-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.product-modal-content {
    position: relative;
    background-color: white;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

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

.product-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-color);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.product-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.product-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
}

.product-modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-modal-main-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--background-color);
}

.product-modal-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-modal-gallery-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-modal-gallery-thumbnails .gallery-main {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--background-color);
}

.product-modal-gallery-thumbnails .gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.product-modal-gallery-thumbnails .gallery-main img:hover {
    transform: scale(1.05);
}

.product-modal-gallery-thumbnails .gallery-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.product-modal-gallery-thumbnails .gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
}

.product-modal-gallery-thumbnails .gallery-thumbs::-webkit-scrollbar {
    height: 4px;
}

.product-modal-gallery-thumbnails .gallery-thumbs::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 2px;
}

.product-modal-gallery-thumbnails .gallery-thumbs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.product-modal-gallery-thumbnails .thumb {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    object-fit: cover;
}

.product-modal-gallery-thumbnails .thumb:hover {
    border-color: var(--primary-color);
    opacity: 0.8;
}

.product-modal-gallery-thumbnails .thumb.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.product-modal-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0px;
}

.product-modal-details h1 {
    font-size: 28px;
    color: var(--text-color);
    line-height: 1.2;
}

.product-modal-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.product-modal-price {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 20px;
    font-weight: 600;
}

.product-modal-old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 18px;
}

.product-modal-new-price {
    color: var(--primary-color);
    font-size: 28px;
}

.product-modal-description {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 20px;
    background-color: var(--background-color);
    border-radius: 8px;
    border-right: 3px solid var(--primary-color);
}

.product-modal-add-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

.product-modal-add-btn:hover {
    background-color: var(--secondary-color);
}

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

.product-modal-add-btn.sold-out {
    background-color: #ccc;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .product-modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .product-modal-details h1 {
        font-size: 22px;
    }
    
    .product-modal-content {
        width: 95%;
        border-radius: 8px;
    }
    
    .product-modal-close {
        top: 10px;
        right: 10px;
    }
}