/* ==========================================================================
   AL-MARVA GREEN DESIGN SYSTEM — Frontend CSS Tokens & Global Styles
   Single source of truth for all UI variables (Section 2 of Implementation)
   ========================================================================== */

:root {
    /* Primary Colors — AL-MARVA Green */
    --almarva-green: #00A859;
    --almarva-green-hover: #00914D;
    --almarva-green-light: #e6f7ef;
    --almarva-green-dark: #007A3E;

    /* Neutrals */
    --almarva-bg: #f5f6f8;
    --almarva-card-bg: #ffffff;
    --almarva-text: #1a1a1a;
    --almarva-text-secondary: #666666;
    --almarva-text-muted: #999999;
    --almarva-border: #e8e8e8;
    --almarva-border-light: #f0f0f0;

    /* Border Radius */
    --almarva-radius-card: 16px;
    --almarva-radius-btn: 999px;
    --almarva-radius-btn-rect: 14px;
    --almarva-radius-input: 12px;
    --almarva-radius-sm: 8px;

    /* Shadows */
    --almarva-shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --almarva-shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --almarva-shadow-lg: 0 8px 32px rgba(0,0,0,0.12);

    /* Typography */
    --almarva-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;

    /* Stars */
    --almarva-star: #FFB900;
}

/* ==========================================================================
   GLOBAL: Override ALL purple elements to green
   ========================================================================== */
body .almarva-store-button:hover,
body .almarva-filter-apply,
body .almarva-pagination .page-numbers.current,
body .almarva-store-tab:hover,
body .almarva-store-tab.active,
body .almarva-mobile-filter-close,
body .almarva-wishlist-btn.active,
body .almarva-wallet-header-btn,
body .almarva-search-btn {
    background-color: var(--almarva-green) !important;
    border-color: var(--almarva-green) !important;
    color: #fff !important;
}

/* Focus states */
body .almarva-price-filter input[type="number"]:focus,
body .almarva-search-input:focus {
    border-color: var(--almarva-green) !important;
    box-shadow: 0 0 0 2px rgba(0,168,89,0.15) !important;
}

/* Checkbox & hover accents */
body .almarva-cat-filter-list input[type="checkbox"] {
    accent-color: var(--almarva-green) !important;
}

body .almarva-cat-filter-list label:hover {
    color: var(--almarva-green) !important;
}

body .almarva-pagination .page-numbers:hover {
    border-color: var(--almarva-green) !important;
    color: var(--almarva-green) !important;
}

body .almarva-mobile-filter-toggle:hover {
    border-color: var(--almarva-green) !important;
    color: var(--almarva-green) !important;
}

/* ==========================================================================
   GLOBAL: Rounded UI — Cards, Buttons, Inputs
   ========================================================================== */

/* Product Cards - rounded consistently everywhere */
body.almarva-store-page ul.products li.product,
body.almarva-product-archive ul.products li.product,
body.almarva-single-product .almarva-store-card,
body .almarva-description-section,
body .almarva-reviews-section,
body .almarva-wishlist-page-card,
body .almarva-wallet-card,
body .almarva-filter-widget {
    border-radius: var(--almarva-radius-card) !important;
    overflow: hidden;
}

/* Buttons - pill style */
body .almarva-store-button,
body .almarva-filter-apply,
body .almarva-filter-reset,
body .almarva-store-card-btn,
body .almarva-wishlist-btn,
body .almarva-wallet-header-btn,
body .almarva-search-btn {
    border-radius: var(--almarva-radius-btn) !important;
}

/* Inputs */
body .almarva-price-filter input[type="number"],
body .almarva-search-input,
body .almarva-sort-select,
body .almarva-wallet-amount-input {
    border-radius: var(--almarva-radius-input) !important;
}

/* WooCommerce add-to-cart buttons GREEN */
body.almarva-store-page ul.products li.product .button,
body.almarva-product-archive ul.products li.product .button,
body .woocommerce ul.products li.product .button,
body.woocommerce ul.products li.product .button,
body .woocommerce ul.products li.product a.add_to_cart_button,
body .woocommerce ul.products li.product a.product_type_variable {
    background-color: var(--almarva-green) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--almarva-radius-btn-rect) !important;
    font-weight: 600 !important;
    transition: background 0.2s ease !important;
    text-align: center !important;
}

body.almarva-store-page ul.products li.product .button:hover,
body.almarva-product-archive ul.products li.product .button:hover,
body .woocommerce ul.products li.product .button:hover,
body .woocommerce ul.products li.product a.add_to_cart_button:hover,
body .woocommerce ul.products li.product a.product_type_variable:hover {
    background-color: var(--almarva-green-hover) !important;
}

/* Single product add-to-cart */
body.almarva-single-product .single_add_to_cart_button,
body .woocommerce div.product form.cart .single_add_to_cart_button {
    background-color: var(--almarva-green) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--almarva-radius-btn-rect) !important;
    font-weight: 600 !important;
    padding: 12px 30px !important;
    font-size: 16px !important;
    transition: background 0.2s ease !important;
}

body.almarva-single-product .single_add_to_cart_button:hover,
body .woocommerce div.product form.cart .single_add_to_cart_button:hover {
    background-color: var(--almarva-green-hover) !important;
}

/* ==========================================================================
   SECTION 3: Product Cards — No Store/Brand Button
   ========================================================================== */

/* Hide store/brand button from product loop cards */
.almarva-store-button--loop {
    display: none !important;
}

/* ==========================================================================
   SECTION 4: Store Banner — Fixed Height + Pan Animation
   ========================================================================== */

.almarva-store-wrapper .store-header {
    position: relative;
    height: 480px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding-bottom: 30px;
}

.almarva-store-wrapper .store-header .store-banner-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: almarva-banner-pan 25s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes almarva-banner-pan {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-25%);
    }
}

/* Desktop: subtle or no pan (keep stable premium look) */
@media (min-width: 769px) {
    .almarva-store-wrapper .store-header .store-banner-bg {
        width: 120%;
        animation-duration: 30s;
    }

    @keyframes almarva-banner-pan {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(-10%);
        }
    }

    .almarva-store-wrapper .store-header {
        height: 480px;
    }
}

/* Mobile: narrower viewport pans more */
@media (max-width: 768px) {
    .almarva-store-wrapper .store-header {
        height: 280px;
        padding-bottom: 20px;
    }

    .almarva-store-wrapper .store-header .store-banner-bg {
        width: 250%;
        animation-duration: 20s;
    }
}

/* ==========================================================================
   SECTION 5: Store Page — Mobile Tabs + Desktop Sidebar
   ========================================================================== */

/* Store tabs GREEN accent */
.almarva-store-tab:hover,
.almarva-store-tab.active {
    color: var(--almarva-green) !important;
    border-bottom-color: var(--almarva-green) !important;
}

/* Filter apply button GREEN */
.almarva-filter-apply {
    background: var(--almarva-green) !important;
}

.almarva-filter-apply:hover {
    background: var(--almarva-green-hover) !important;
}

/* Mobile filter close GREEN */
.almarva-mobile-filter-close {
    background: var(--almarva-green) !important;
}

/* Pagination current GREEN */
.almarva-pagination .page-numbers.current {
    background: var(--almarva-green) !important;
    border-color: var(--almarva-green) !important;
}

/* ==========================================================================
   SECTION 6: Single Product — Nivea-Style Store Card
   ========================================================================== */

.almarva-store-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--almarva-card-bg);
    border-radius: var(--almarva-radius-card);
    box-shadow: var(--almarva-shadow-sm);
    margin: 20px 0;
    border: 1px solid var(--almarva-border-light);
    transition: box-shadow 0.2s ease;
}

.almarva-store-card:hover {
    box-shadow: var(--almarva-shadow-md);
}

.almarva-store-card-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--almarva-border);
}

.almarva-store-card-info {
    flex: 1;
    min-width: 0;
}

.almarva-store-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--almarva-text);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.almarva-store-card-rating {
    font-size: 13px;
    color: var(--almarva-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.almarva-store-card-rating .almarva-stars {
    color: var(--almarva-star);
    font-size: 14px;
}

.almarva-store-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--almarva-green);
    color: #fff;
    border: none;
    border-radius: var(--almarva-radius-btn);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.almarva-store-card-btn:hover {
    background: var(--almarva-green-hover);
    color: #fff;
    text-decoration: none;
}

/* Hide old store button on single product */
.almarva-single-product .almarva-store-meta {
    display: none !important;
}

/* Description & Reviews sections rounded */
.almarva-description-section {
    background: var(--almarva-card-bg);
    border-radius: var(--almarva-radius-card);
    padding: 24px;
    box-shadow: var(--almarva-shadow-sm);
}

.almarva-reviews-section {
    background: var(--almarva-card-bg);
    border-radius: var(--almarva-radius-card);
    padding: 24px;
    box-shadow: var(--almarva-shadow-sm);
}

/* Reviews form rounded */
.almarva-reviews-section .comment-respond {
    background: var(--almarva-bg);
    border-radius: var(--almarva-radius-card);
    padding: 20px;
    margin-top: 20px;
}

.almarva-reviews-section .comment-respond input[type="text"],
.almarva-reviews-section .comment-respond input[type="email"],
.almarva-reviews-section .comment-respond textarea {
    border-radius: var(--almarva-radius-input);
    border: 1px solid var(--almarva-border);
    padding: 10px 14px;
    width: 100%;
    box-sizing: border-box;
}

.almarva-reviews-section .comment-respond .form-submit input[type="submit"] {
    background: var(--almarva-green) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--almarva-radius-btn) !important;
    padding: 12px 32px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
}

.almarva-reviews-section .comment-respond .form-submit input[type="submit"]:hover {
    background: var(--almarva-green-hover) !important;
}

/* Individual review comment rounded */
.almarva-reviews-section .commentlist .comment {
    padding: 16px;
    border-bottom: 1px solid var(--almarva-border-light);
    border-radius: var(--almarva-radius-sm);
}

.almarva-reviews-section .commentlist .comment:last-child {
    border-bottom: none;
}

/* ==========================================================================
   SECTION 7: Reviews Login Notice
   ========================================================================== */

.almarva-reviews-login-notice {
    background: var(--almarva-green-light);
    border: 1px solid var(--almarva-green);
    border-radius: var(--almarva-radius-card);
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.almarva-reviews-login-notice p {
    font-size: 15px;
    color: var(--almarva-text);
    margin: 0 0 12px;
}

.almarva-reviews-login-notice a,
.almarva-reviews-login-notice button.almarva-guest-review-btn {
    display: inline-block;
    background: var(--almarva-green);
    color: #fff;
    padding: 10px 28px;
    border-radius: var(--almarva-radius-btn);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.4;
}

.almarva-reviews-login-notice a:hover,
.almarva-reviews-login-notice button.almarva-guest-review-btn:hover {
    background: var(--almarva-green-hover);
    color: #fff;
}

/* Extra safety: hide any comment form fields that leak through for guests */
.almarva-reviews-login-notice ~ .comment-form-author,
.almarva-reviews-login-notice ~ .comment-form-email,
.almarva-reviews-login-notice ~ .comment-form-url,
.almarva-reviews-login-notice ~ .form-submit {
    display: none !important;
}

/* ==========================================================================
   SECTION 8: Wishlist (Sevimlilar)
   ========================================================================== */

/* Heart icon on product cards */
.almarva-wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #ccc;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    line-height: 1;
    padding: 0;
}

.almarva-wishlist-btn:hover {
    color: #e74c3c;
    background: rgba(255,255,255,1) !important;
    border-color: transparent !important;
    transform: scale(1.1);
}

.almarva-wishlist-btn.active {
    color: #fff !important;
    background: #e74c3c !important;
    border-color: #e74c3c !important;
}

/* Product card needs relative position for wishlist btn */
body ul.products li.product {
    position: relative;
}

/* Wishlist page */
.almarva-wishlist-page {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

.almarva-wishlist-page h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--almarva-text);
    margin: 0 0 20px;
}

.almarva-wishlist-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--almarva-card-bg);
    border-radius: var(--almarva-radius-card);
    box-shadow: var(--almarva-shadow-sm);
}

.almarva-wishlist-empty p {
    font-size: 16px;
    color: var(--almarva-text-secondary);
    margin: 0 0 16px;
}

.almarva-wishlist-empty a {
    display: inline-block;
    background: var(--almarva-green);
    color: #fff;
    padding: 12px 32px;
    border-radius: var(--almarva-radius-btn);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.almarva-wishlist-empty a:hover {
    background: var(--almarva-green-hover);
}

.almarva-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 992px) {
    .almarva-wishlist-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .almarva-wishlist-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.almarva-wishlist-item {
    background: var(--almarva-card-bg);
    border-radius: var(--almarva-radius-card);
    overflow: hidden;
    box-shadow: var(--almarva-shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}

.almarva-wishlist-item:hover {
    box-shadow: var(--almarva-shadow-md);
    transform: translateY(-2px);
}

.almarva-wishlist-item img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}

.almarva-wishlist-item-info {
    padding: 12px;
}

.almarva-wishlist-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--almarva-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 6px;
    line-height: 1.4;
}

.almarva-wishlist-item-title a {
    color: inherit;
    text-decoration: none;
}

.almarva-wishlist-item-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--almarva-text);
}

.almarva-wishlist-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(231,76,60,0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    line-height: 1;
    padding: 0;
}

.almarva-wishlist-remove:hover {
    background: #c0392b;
}

/* ==========================================================================
   SECTION 9: Search — Custom Header Search
   ========================================================================== */

.almarva-header-search-wrap {
    display: flex;
    justify-content: center;
    padding: 10px 15px;
    background: #fff;
    border-bottom: 1px solid var(--almarva-border-light);
    position: sticky;
    top: 0;
    z-index: 999;
}

.almarva-header-search {
    display: flex;
    align-items: center;
    max-width: 500px;
    width: 100%;
    position: relative;
}

.almarva-search-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--almarva-border);
    border-right: none;
    border-radius: var(--almarva-radius-input) 0 0 var(--almarva-radius-input);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    background: #fff;
}

.almarva-search-input:focus {
    border-color: var(--almarva-green);
}

.almarva-search-btn {
    padding: 10px 20px;
    background: var(--almarva-green);
    color: #fff;
    border: 2px solid var(--almarva-green);
    border-radius: 0 var(--almarva-radius-input) var(--almarva-radius-input) 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.almarva-search-btn:hover {
    background: var(--almarva-green-hover);
    border-color: var(--almarva-green-hover);
}

/* Mobile search */
.almarva-mobile-search-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--almarva-text);
    padding: 6px;
}

@media (max-width: 768px) {
    .almarva-header-search {
        max-width: 100%;
    }

    .almarva-search-input {
        font-size: 13px;
        padding: 8px 12px;
    }

    .almarva-search-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* ==========================================================================
   SECTION 10: Wallet (Hamyon) — Header + Page
   ========================================================================== */

/* Wallet header display */
.almarva-wallet-header {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
    color: var(--almarva-text);
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    background: var(--almarva-green-light);
    border-radius: var(--almarva-radius-btn);
    transition: background 0.2s ease;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    box-shadow: var(--almarva-shadow-md);
}

.almarva-wallet-header:hover {
    background: var(--almarva-green);
    color: #fff;
    text-decoration: none;
}

.almarva-wallet-header .wallet-icon {
    font-weight: 700;
    font-size: 16px;
}

.almarva-wallet-header .wallet-amount {
    font-variant-numeric: tabular-nums;
}

/* Wallet page */
.almarva-wallet-page {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 15px;
}

.almarva-wallet-balance-card {
    display: flex;
    gap: 24px;
    background: var(--almarva-card-bg);
    border-radius: var(--almarva-radius-card);
    padding: 28px;
    box-shadow: var(--almarva-shadow-sm);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.almarva-wallet-balance-item {
    flex: 1;
    min-width: 160px;
}

.almarva-wallet-balance-label {
    font-size: 13px;
    color: var(--almarva-text-muted);
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.almarva-wallet-balance-amount {
    font-size: 28px;
    font-weight: 800;
    color: var(--almarva-green);
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.almarva-wallet-balance-amount.pending {
    color: var(--almarva-text-secondary);
    font-size: 22px;
}

/* How it works */
.almarva-wallet-rules {
    background: var(--almarva-green-light);
    border-radius: var(--almarva-radius-card);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.almarva-wallet-rules h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--almarva-green-dark);
    margin: 0 0 10px;
}

.almarva-wallet-rules ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.almarva-wallet-rules ul li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--almarva-text-secondary);
    border-bottom: 1px solid rgba(0,168,89,0.1);
}

.almarva-wallet-rules ul li:last-child {
    border-bottom: none;
}

.almarva-wallet-rules ul li strong {
    color: var(--almarva-text);
}

/* Transaction history */
.almarva-wallet-history {
    background: var(--almarva-card-bg);
    border-radius: var(--almarva-radius-card);
    box-shadow: var(--almarva-shadow-sm);
    overflow: hidden;
    margin-bottom: 24px;
}

.almarva-wallet-history h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--almarva-border-light);
}

.almarva-wallet-history table {
    width: 100%;
    border-collapse: collapse;
}

.almarva-wallet-history th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--almarva-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--almarva-border-light);
    background: var(--almarva-bg);
}

.almarva-wallet-history td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--almarva-text);
    border-bottom: 1px solid var(--almarva-border-light);
}

.almarva-wallet-history tr:last-child td {
    border-bottom: none;
}

.almarva-wallet-tx-positive {
    color: var(--almarva-green);
    font-weight: 600;
}

.almarva-wallet-tx-negative {
    color: #e74c3c;
    font-weight: 600;
}

.almarva-wallet-tx-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--almarva-radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.almarva-wallet-tx-type.cashback {
    background: var(--almarva-green-light);
    color: var(--almarva-green);
}

.almarva-wallet-tx-type.spent {
    background: #ffeaea;
    color: #e74c3c;
}

.almarva-wallet-tx-type.refund {
    background: #fff3e0;
    color: #e67e22;
}

.almarva-wallet-tx-type.adjustment {
    background: #eee;
    color: #666;
}

.almarva-wallet-tx-pending {
    font-size: 11px;
    background: #fff3e0;
    color: #e67e22;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Rules accordion */
.almarva-wallet-accordion {
    background: var(--almarva-card-bg);
    border-radius: var(--almarva-radius-card);
    box-shadow: var(--almarva-shadow-sm);
    overflow: hidden;
}

.almarva-wallet-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--almarva-text);
    background: var(--almarva-card-bg);
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.2s ease;
}

.almarva-wallet-accordion-header:hover {
    background: var(--almarva-bg);
}

.almarva-wallet-accordion-header .toggle-icon {
    transition: transform 0.2s ease;
}

.almarva-wallet-accordion-header.open .toggle-icon {
    transform: rotate(180deg);
}

.almarva-wallet-accordion-body {
    display: none;
    padding: 0 24px 20px;
    font-size: 14px;
    color: var(--almarva-text-secondary);
    line-height: 1.7;
}

.almarva-wallet-accordion-body.open {
    display: block;
}

/* Checkout wallet usage */
.almarva-checkout-wallet {
    background: var(--almarva-green-light);
    border: 1px solid var(--almarva-green);
    border-radius: var(--almarva-radius-card);
    padding: 20px;
    margin: 16px 0;
}

.almarva-checkout-wallet h4 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--almarva-green-dark);
}

.almarva-checkout-wallet label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
}

.almarva-checkout-wallet .wallet-balance-info {
    font-size: 13px;
    color: var(--almarva-text-secondary);
    margin-bottom: 10px;
}

.almarva-wallet-amount-input {
    width: 100%;
    max-width: 200px;
    padding: 8px 14px;
    border: 1px solid var(--almarva-border);
    border-radius: var(--almarva-radius-input);
    font-size: 14px;
}

/* Responsive wallet */
@media (max-width: 768px) {
    .almarva-wallet-balance-card {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }

    .almarva-wallet-balance-amount {
        font-size: 24px;
    }

    .almarva-wallet-history th,
    .almarva-wallet-history td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ==========================================================================
   GLOBAL: Hide old store button from all product loops
   ========================================================================== */
.almarva-store-button.almarva-store-button--loop {
    display: none !important;
}

/* ==========================================================================
   WooCommerce reviews: hide login fields, show custom notice
   ========================================================================== */
.almarva-single-product .comment-form-author,
.almarva-single-product .comment-form-email {
    /* Let WooCommerce handle, but we redirect logged-out users */
}

/* ==========================================================================
   PHASE 1: Product Gallery — Disable Zoom/Magnifier Icon
   ========================================================================== */

/* Hide WooCommerce zoom trigger / magnifier overlay on single product */
body.almarva-single-product .woocommerce-product-gallery__trigger,
body.almarva-single-product .zoomImg,
body.almarva-single-product .woocommerce-product-gallery .zoomImg,
body.almarva-single-product .woocommerce-product-gallery__image .zoomImg {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Remove any hover zoom effect */
body.almarva-single-product .woocommerce-product-gallery__image {
    cursor: pointer;
}

body.almarva-single-product .woocommerce-product-gallery__image img {
    cursor: pointer;
}

/* Custom zoom/view icon overlay — clean SVG icon */
.almarva-gallery-zoom-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    transition: background 0.2s ease;
}

.almarva-gallery-zoom-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.almarva-single-product .woocommerce-product-gallery__image:hover .almarva-gallery-zoom-icon {
    background: rgba(0, 0, 0, 0.65);
}

/* Gallery image wrapper needs relative positioning */
body.almarva-single-product .woocommerce-product-gallery__image {
    position: relative;
}

/* Gallery stable layout: keep original aspect ratio, no forced 1:1 */
body.almarva-single-product .woocommerce-product-gallery {
    opacity: 1 !important;
}

/* Custom Lightbox Modal */
.almarva-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.almarva-lightbox-overlay.active {
    display: flex;
}

.almarva-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}

.almarva-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.almarva-lightbox-img-wrap {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.almarva-lightbox-img-wrap img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    -webkit-user-select: none;
}

.almarva-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
}

.almarva-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.almarva-lightbox-prev {
    left: 10px;
}

.almarva-lightbox-next {
    right: 10px;
}

.almarva-lightbox-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
}

/* ==========================================================================
   PHASE 2 & 6: Category-only meta line
   ========================================================================== */

.almarva-category-line {
    font-size: 14px;
    color: var(--almarva-text-secondary);
    margin: 12px 0 6px;
    line-height: 1.5;
}

.almarva-category-label {
    font-weight: 600;
    color: var(--almarva-text);
}

.almarva-category-line a {
    color: var(--almarva-green);
    text-decoration: none;
    transition: color 0.2s ease;
}

.almarva-category-line a:hover {
    color: var(--almarva-green-hover);
    text-decoration: underline;
}

/* Hide any leftover WooCommerce meta (SKU, Brand, Tags) on single product */
body.almarva-single-product .product_meta {
    display: none !important;
}

/* Hide brand output from any brand plugin */
body.almarva-single-product .pwb-single-product-brands,
body.almarva-single-product .woocommerce-product-brands,
body.almarva-single-product .product-brand,
body.almarva-single-product .posted_in_brand,
body.almarva-single-product [class*="brand"] .posted_in {
    display: none !important;
}

/* ==========================================================================
   PHASE 3: Guest Review Button (Sharh qoldirish)
   ========================================================================== */

.almarva-guest-review-btn {
    display: inline-block;
    background: var(--almarva-green);
    color: #fff;
    padding: 12px 32px;
    border: none;
    border-radius: var(--almarva-radius-btn);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}

.almarva-guest-review-btn:hover {
    background: var(--almarva-green-hover);
    transform: scale(1.02);
}

.almarva-guest-review-btn:active {
    transform: scale(0.98);
}

/* Toast notification */
.almarva-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--almarva-green);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--almarva-radius-btn);
    font-size: 14px;
    font-weight: 600;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    box-shadow: var(--almarva-shadow-md);
    white-space: nowrap;
}

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

/* ==========================================================================
   PHASE 4: Desktop Reviews Layout Fix — Full Width + Custom Review Items
   ========================================================================== */

body.almarva-single-product .almarva-reviews-section {
    width: 100%;
    max-width: 1100px;
    margin: 30px auto;
    padding: 24px;
    box-sizing: border-box;
}

body.almarva-single-product .almarva-reviews-section #reviews {
    width: 100%;
}

/* Custom reviews list */
.almarva-reviews-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.almarva-review-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--almarva-border-light);
}

.almarva-review-item:last-child {
    border-bottom: none;
}

.almarva-review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.almarva-review-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.almarva-review-meta {
    flex: 1;
}

.almarva-review-author {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--almarva-text);
}

.almarva-review-date {
    display: block;
    font-size: 12px;
    color: var(--almarva-text-muted);
}

.almarva-review-stars {
    color: var(--almarva-star);
    font-size: 16px;
    letter-spacing: 1px;
}

.almarva-review-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--almarva-text-secondary);
}

.almarva-review-body p {
    margin: 0;
}

.almarva-no-reviews {
    text-align: center;
    padding: 30px;
    color: var(--almarva-text-muted);
    font-size: 15px;
}

/* Hide WooCommerce default comment list when we render our own above */
.almarva-review-form-wrap .commentlist {
    display: none !important;
}

.almarva-review-form-wrap #comments > h2 {
    display: none !important;
}

body.almarva-single-product .almarva-reviews-section .commentlist {
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

body.almarva-single-product .almarva-reviews-section .commentlist .comment {
    padding: 16px 0;
    border-bottom: 1px solid var(--almarva-border-light);
}

body.almarva-single-product .almarva-reviews-section .commentlist .comment:last-child {
    border-bottom: none;
}

/* Review form full width inputs */
body.almarva-single-product .almarva-reviews-section .comment-respond {
    width: 100%;
    box-sizing: border-box;
}

body.almarva-single-product .almarva-reviews-section .comment-respond input[type="text"],
body.almarva-single-product .almarva-reviews-section .comment-respond input[type="email"],
body.almarva-single-product .almarva-reviews-section .comment-respond textarea {
    width: 100% !important;
    box-sizing: border-box;
    border-radius: var(--almarva-radius-input);
    border: 1px solid var(--almarva-border);
    padding: 12px 16px;
    font-size: 14px;
}

/* Star rating in form */
body.almarva-single-product .almarva-reviews-section .comment-respond .stars {
    margin-bottom: 8px;
}

/* ==========================================================================
   PHASE 5: Description Content Image Ratio Fix (no forced 1:1)
   ========================================================================== */

/* ==========================================================================
   PHASE 1 FIX: Clearfix / Layout Break after Summary
   Prevents float overlap when tabs are removed
   ========================================================================== */

body.almarva-single-product .almarva-layout-break {
    clear: both !important;
    width: 100% !important;
    height: 0 !important;
    overflow: hidden !important;
    float: none !important;
    display: block !important;
}

/* Ensure custom sections container starts clean below summary */
body.almarva-single-product .almarva-description-section,
body.almarva-single-product .almarva-reviews-section {
    clear: both !important;
    float: none !important;
    width: 100% !important;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 30px;
    box-sizing: border-box;
    display: block !important;
    position: relative;
}

/* Force woocommerce_after_single_product_summary to be full-width block */
body.almarva-single-product div.product::after {
    content: '';
    display: table;
    clear: both;
}

/* Prevent theme from constraining description to gallery/summary column width */
body.almarva-single-product div.product > .almarva-layout-break,
body.almarva-single-product div.product > .almarva-description-section,
body.almarva-single-product div.product > .almarva-reviews-section {
    flex-basis: 100% !important;
    flex: 0 0 100% !important;
    max-width: 1100px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* If theme uses flexbox on div.product, force wrap */
body.almarva-single-product div.product {
    flex-wrap: wrap !important;
}

/* Ensure description images show at their natural aspect ratio */
body.almarva-single-product .almarva-description-section img {
    aspect-ratio: auto !important;
    height: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
}

/* ==========================================================================
   PHASE 3: Expand/Collapse Description ("Tavsifni kengaytirish")
   ========================================================================== */

.almarva-desc-collapsible {
    position: relative;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.almarva-desc-collapsible[data-collapsed="true"] {
    max-height: 420px;
}

.almarva-desc-collapsible[data-collapsed="false"] {
    max-height: none;
}

/* Fade-out overlay at bottom when collapsed */
.almarva-desc-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.almarva-desc-collapsible[data-collapsed="false"] .almarva-desc-fade {
    opacity: 0;
}

/* Toggle button */
.almarva-desc-toggle {
    display: block;
    width: 100%;
    padding: 14px 24px;
    margin-top: 0;
    background: var(--almarva-green-light);
    color: var(--almarva-green);
    border: 1px solid var(--almarva-green);
    border-radius: 0 0 var(--almarva-radius-card) var(--almarva-radius-card);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    text-align: center;
}

.almarva-desc-toggle:hover {
    background: var(--almarva-green);
    color: #fff;
}

.almarva-desc-toggle:focus {
    outline: 2px solid var(--almarva-green);
    outline-offset: -2px;
}

/* When description is short, hide button and fade */
.almarva-desc-collapsible.almarva-desc-short {
    max-height: none !important;
}

.almarva-desc-collapsible.almarva-desc-short .almarva-desc-fade {
    display: none;
}

/* Mobile threshold */
@media (max-width: 768px) {
    .almarva-desc-collapsible[data-collapsed="true"] {
        max-height: 320px;
    }

    .almarva-desc-toggle {
        font-size: 14px;
        padding: 12px 20px;
    }
}

/* ==========================================================================
   PHASE 5 CONTINUED: Description Content Image Ratio Fix (no forced 1:1)
   ========================================================================== */

/* Reset ALL images INSIDE the description section to their natural ratio */
body.almarva-single-product .almarva-description-section img,
body.almarva-single-product .almarva-description-content img {
    aspect-ratio: auto !important;
    height: auto !important;
    width: auto;
    max-width: 100%;
    object-fit: contain !important;
    display: block;
    margin: 10px auto;
    border-radius: 8px;
}

/* Also reset wp-block images and figure elements inside description */
body.almarva-single-product .almarva-description-content figure {
    max-width: 100%;
    margin: 16px 0;
}

body.almarva-single-product .almarva-description-content figure img {
    aspect-ratio: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Ensure product card portrait rules do NOT apply to description content */
body.almarva-single-product .almarva-description-section .woocommerce-product-gallery__image img {
    /* Do not override gallery images inside description (shouldn't exist, safety rule) */
}

/* ==========================================================================
   PHASE 6: Additional SKU/Brand hide guarantee
   ========================================================================== */

body.almarva-single-product .sku_wrapper,
body.almarva-single-product .tagged_as,
body.almarva-single-product .brands {
    display: none !important;
}

/* Mobile adjustments for new elements */
@media (max-width: 768px) {
    .almarva-lightbox-nav {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .almarva-lightbox-prev {
        left: 5px;
    }

    .almarva-lightbox-next {
        right: 5px;
    }

    .almarva-category-line {
        font-size: 13px;
        margin: 8px 0;
    }

    body.almarva-single-product .almarva-reviews-section {
        padding: 16px 12px;
        margin: 20px auto;
    }

    .almarva-toast {
        font-size: 13px;
        padding: 10px 18px;
    }

    .almarva-gallery-zoom-icon {
        width: 30px;
        height: 30px;
        top: 8px;
        right: 8px;
    }

    .almarva-gallery-zoom-icon svg {
        width: 16px;
        height: 16px;
    }
}
