/**
 * Ayzelify Product Page — Rifat-style B2B wholesale layout.
 *
 * All colors use CSS custom properties set dynamically from plugin settings.
 * The variables --ayzelify-primary, --ayzelify-secondary, etc. are injected
 * inline by the PHP template override.
 */

/* ─── Reset & Container ─────────────────────────────────────────── */
.ayzelify-product-page {
    --ayz-primary: var(--ayzelify-primary, #d4a843);
    --ayz-secondary: var(--ayzelify-secondary, #1a1a2e);
    --ayz-bg: var(--ayzelify-background, #0f0f17);
    --ayz-fg: var(--ayzelify-foreground, #f0ede6);
    --ayz-muted: var(--ayzelify-muted, #9ca3af);
    --ayz-border: var(--ayzelify-border, #2a2a3e);
    --ayz-accent: var(--ayzelify-accent, #10b981);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Helvetica, Arial, sans-serif;
    color: var(--ayz-fg);
    background: var(--ayz-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.ayzelify-product-page *,
.ayzelify-product-page *::before,
.ayzelify-product-page *::after {
    box-sizing: border-box;
}

.ayzelify-product-page img {
    max-width: 100%;
    height: auto;
}

.ayz-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 640px) {
    .ayz-container { padding: 0 24px; }
}

/* ─── Breadcrumb ────────────────────────────────────────────────── */
.ayz-breadcrumb {
    background: var(--ayz-secondary);
    border-bottom: 1px solid var(--ayz-border);
    padding: 12px 0;
    font-size: 12px;
}
.ayz-breadcrumb a {
    color: var(--ayz-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.ayz-breadcrumb a:hover { color: var(--ayz-primary); }
.ayz-breadcrumb .ayz-bc-sep { color: var(--ayz-border); margin: 0 8px; }
.ayz-breadcrumb .ayz-bc-current { color: var(--ayz-fg); font-weight: 600; }

/* ─── 3-Column Grid ─────────────────────────────────────────────── */
.ayz-grid-3col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 0;
    align-items: start;
}
@media (min-width: 1024px) {
    .ayz-grid-3col {
        grid-template-columns: 4fr 5fr 3fr;
    }
}

/* ─── Column 1: Image Gallery ───────────────────────────────────── */
.ayz-gallery {
    background: var(--ayz-secondary);
    border: 1px solid var(--ayz-border);
    padding: 16px;
    border-left: 3px solid var(--ayz-primary);
    position: sticky;
    top: 100px;
}
.ayz-main-image-wrap {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
    min-height: 400px;
    background: #111;
}
.ayz-main-image-wrap img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.1s ease;
    object-fit: contain;
}
.ayz-main-image-wrap:hover img {
    transform: scale(2.2);
}
.ayz-main-image-wrap .ayz-zoom-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    backdrop-filter: blur(4px);
}
.ayz-main-image-wrap:hover .ayz-zoom-hint { display: none; }

.ayz-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.ayz-thumb {
    width: 64px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.ayz-thumb:hover { opacity: 1; }
.ayz-thumb.active {
    border-color: var(--ayz-primary);
    opacity: 1;
}
.ayz-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── Column 2: Product Info ────────────────────────────────────── */
.ayz-product-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ayz-product-title {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    color: var(--ayz-fg);
    margin: 0 0 8px 0;
}
@media (min-width: 640px) {
    .ayz-product-title { font-size: 28px; }
}
.ayz-product-short-desc {
    color: var(--ayz-muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* Slab Pricing Table */
.ayz-slab-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ayz-fg);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ayz-slab-label small {
    font-weight: 400;
    color: var(--ayz-muted);
    text-transform: none;
    letter-spacing: 0;
    font-size: 10px;
}

.ayz-slab-table {
    display: flex;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    border: 1px solid var(--ayz-border);
    overflow: hidden;
}
.ayz-slab-cell {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.2s;
    border-right: 1px solid var(--ayz-border);
    cursor: default;
}
.ayz-slab-cell:last-child { border-right: none; }
.ayz-slab-cell:hover { background: rgba(255,255,255,0.03); }
.ayz-slab-cell.active {
    background: color-mix(in srgb, var(--ayz-primary) 10%, transparent);
    border-bottom: 2px solid var(--ayz-primary);
    position: relative;
}
.ayz-slab-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--ayz-fg);
}
.ayz-slab-cell.active .ayz-slab-price {
    color: var(--ayz-primary);
}
.ayz-slab-qty {
    font-size: 11px;
    color: var(--ayz-muted);
    margin-top: 4px;
    white-space: nowrap;
}
@media (min-width: 640px) {
    .ayz-slab-price { font-size: 24px; }
}

/* Sample Price Badge */
.ayz-sample-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 4px;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--ayz-accent) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--ayz-accent) 20%, transparent);
}
.ayz-sample-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ayz-accent) 15%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ayz-sample-icon svg { width: 20px; height: 20px; color: var(--ayz-accent); }
.ayz-sample-label {
    font-size: 12px;
    color: var(--ayz-muted);
}
.ayz-sample-price-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--ayz-accent);
}
.ayz-sample-lead {
    margin-left: auto;
    font-size: 10px;
    color: var(--ayz-muted);
    text-align: right;
    max-width: 120px;
    line-height: 1.4;
}

/* Estimate Card */
.ayz-card {
    background: var(--ayz-secondary);
    border: 1px solid var(--ayz-border);
    padding: 16px;
    border-left: 3px solid var(--ayz-primary);
}
.ayz-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.ayz-card-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ayz-fg);
}
.ayz-card-subtitle {
    font-size: 10px;
    color: var(--ayz-muted);
}
.ayz-estimate-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}
.ayz-estimate-formula {
    font-size: 14px;
    color: var(--ayz-muted);
}
.ayz-estimate-total {
    font-size: 28px;
    font-weight: 700;
    color: var(--ayz-primary);
    line-height: 1;
}
.ayz-estimate-label {
    font-size: 10px;
    color: var(--ayz-muted);
    text-align: right;
}
.ayz-moq-warning {
    margin-top: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    color: #f59e0b;
}
.ayz-moq-warning svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }

/* Quick Specs */
.ayz-specs-quick {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ayz-spec-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ayz-border);
    font-size: 14px;
}
.ayz-spec-row:last-child { border-bottom: none; padding-bottom: 0; }
.ayz-spec-label { color: var(--ayz-muted); }
.ayz-spec-value { color: var(--ayz-fg); font-weight: 500; }

/* ─── Column 3: Inquiry Sidebar ─────────────────────────────────── */
.ayz-inquiry {
    background: var(--ayz-secondary);
    border: 1px solid var(--ayz-border);
    padding: 20px;
    border-left: 3px solid var(--ayz-primary);
    position: sticky;
    top: 100px;
}
.ayz-inquiry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--ayz-border);
}
.ayz-inquiry-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ayz-fg);
    margin: 0;
}
.ayz-reply-badge {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--ayz-primary);
    background: color-mix(in srgb, var(--ayz-primary) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--ayz-primary) 20%, transparent);
    padding: 4px 10px;
    border-radius: 999px;
}

/* Size / Color selectors */
.ayz-selector-group {
    margin-bottom: 16px;
}
.ayz-selector-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ayz-fg);
    margin-bottom: 8px;
    display: block;
}
.ayz-selector-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ayz-option-btn {
    min-width: 40px;
    padding: 6px 10px;
    font-size: 12px;
    text-align: center;
    border: 1px solid var(--ayz-border);
    background: transparent;
    color: var(--ayz-muted);
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
    font-family: inherit;
}
.ayz-option-btn:hover { border-color: var(--ayz-fg); color: var(--ayz-fg); }
.ayz-option-btn.active {
    border-color: var(--ayz-primary);
    background: color-mix(in srgb, var(--ayz-primary) 5%, transparent);
    color: var(--ayz-fg);
    font-weight: 700;
}

/* Quantity stepper */
.ayz-qty-stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--ayz-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}
.ayz-qty-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    border: none;
    color: var(--ayz-fg);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}
.ayz-qty-btn:hover { background: rgba(255,255,255,0.06); }
.ayz-qty-input {
    flex: 1;
    height: 40px;
    text-align: center;
    background: transparent;
    border: none;
    border-left: 1px solid var(--ayz-border);
    border-right: 1px solid var(--ayz-border);
    color: var(--ayz-fg);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    font-family: inherit;
    -moz-appearance: textfield;
}
.ayz-qty-input::-webkit-inner-spin-button,
.ayz-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Contact fields */
.ayz-form-divider {
    border-top: 1px solid var(--ayz-border);
    padding-top: 16px;
    margin-bottom: 16px;
}
.ayz-form-divider span {
    font-size: 12px;
    font-weight: 600;
    color: var(--ayz-fg);
}
.ayz-field {
    position: relative;
    margin-bottom: 10px;
}
.ayz-field svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--ayz-muted);
    pointer-events: none;
}
.ayz-field input,
.ayz-field textarea {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--ayz-border);
    border-radius: 2px;
    color: var(--ayz-fg);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
.ayz-field textarea {
    padding-left: 12px;
    resize: none;
    min-height: 60px;
}
.ayz-field input:focus,
.ayz-field textarea:focus {
    border-color: color-mix(in srgb, var(--ayz-primary) 50%, transparent);
}
.ayz-field input::placeholder,
.ayz-field textarea::placeholder {
    color: color-mix(in srgb, var(--ayz-muted) 60%, transparent);
}

/* CTA Buttons */
.ayz-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}
.ayz-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}
.ayz-btn:hover::before { left: 100%; }

.ayz-btn-primary {
    background: var(--ayz-primary);
    color: #000;
}
.ayz-btn-primary:hover { filter: brightness(1.1); }
.ayz-btn-secondary {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
}
.ayz-btn-outline {
    background: transparent;
    border: 1px solid var(--ayz-border);
    color: var(--ayz-fg);
}
.ayz-btn-outline:hover {
    border-color: var(--ayz-primary);
    color: var(--ayz-primary);
}
.ayz-btn + .ayz-btn { margin-top: 10px; }

.ayz-btn svg { width: 16px; height: 16px; }

/* Trust signals */
.ayz-trust {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--ayz-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ayz-trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: var(--ayz-muted);
}
.ayz-trust-item svg { width: 12px; height: 12px; }

/* ─── Below the Fold: Tabbed Content ────────────────────────────── */
.ayz-below-fold {
    padding: 32px 0 80px;
}
.ayz-content-card {
    background: var(--ayz-secondary);
    border: 1px solid var(--ayz-border);
    overflow: hidden;
    border-left: 3px solid var(--ayz-primary);
}

/* Tab nav */
.ayz-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--ayz-border);
    background: rgba(255,255,255,0.02);
    position: sticky;
    top: 0;
    z-index: 10;
}
.ayz-tab {
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    color: var(--ayz-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    font-family: inherit;
}
.ayz-tab:hover { color: var(--ayz-fg); }
.ayz-tab.active {
    color: var(--ayz-primary);
    border-bottom-color: var(--ayz-primary);
    background: var(--ayz-bg);
}

.ayz-tab-content {
    padding: 24px;
    display: none;
}
.ayz-tab-content.active { display: block; }
@media (min-width: 768px) {
    .ayz-tab-content { padding: 40px; }
}

/* Section headings */
.ayz-section-heading {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ayz-fg);
    margin: 0 0 24px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ayz-section-heading::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--ayz-primary);
    flex-shrink: 0;
}

/* Description */
.ayz-description {
    color: var(--ayz-muted);
    font-size: 14px;
    line-height: 2;
    white-space: pre-line;
    max-width: 900px;
}

/* Key features list */
.ayz-features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
@media (min-width: 640px) {
    .ayz-features-list { grid-template-columns: 1fr 1fr; }
}
.ayz-features-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--ayz-muted);
    padding: 8px 0;
}
.ayz-features-list li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--ayz-primary);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 7px;
}

/* Specs table */
.ayz-specs-table {
    display: grid;
    grid-template-columns: 1fr;
    border-top: 1px solid var(--ayz-border);
    border-left: 1px solid var(--ayz-border);
    border-radius: 4px;
    overflow: hidden;
    font-size: 14px;
}
@media (min-width: 768px) {
    .ayz-specs-table { grid-template-columns: 1fr 1fr; }
}
.ayz-spec-table-row {
    display: flex;
    border-bottom: 1px solid var(--ayz-border);
    border-right: 1px solid var(--ayz-border);
}
.ayz-spec-table-label {
    width: 40%;
    padding: 12px;
    font-weight: 600;
    color: var(--ayz-muted);
    background: rgba(255,255,255,0.02);
}
.ayz-spec-table-value {
    width: 60%;
    padding: 12px;
    color: var(--ayz-fg);
}

/* Logistics section */
.ayz-logistics {
    background: rgba(255,255,255,0.02);
    padding: 32px;
    border: 1px solid var(--ayz-border);
    margin-top: 48px;
    border-left: 3px solid var(--ayz-primary);
}
.ayz-logistics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}
@media (min-width: 768px) {
    .ayz-logistics-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.ayz-logistics-item {
    display: flex;
    gap: 16px;
}
.ayz-logistics-item svg {
    width: 32px;
    height: 32px;
    color: var(--ayz-muted);
    flex-shrink: 0;
}
.ayz-logistics-item h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--ayz-fg);
    margin: 0 0 4px 0;
}
.ayz-logistics-item p {
    font-size: 12px;
    color: var(--ayz-muted);
    line-height: 1.6;
    margin: 0;
}

/* FAQ section */
.ayz-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ayz-faq-item {
    border: 1px solid var(--ayz-border);
    border-radius: 4px;
    overflow: hidden;
}
.ayz-faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(255,255,255,0.02);
    border: none;
    color: var(--ayz-fg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.2s;
}
.ayz-faq-q:hover { background: rgba(255,255,255,0.04); }
.ayz-faq-q svg {
    width: 16px;
    height: 16px;
    color: var(--ayz-muted);
    transition: transform 0.3s;
    flex-shrink: 0;
}
.ayz-faq-item.open .ayz-faq-q svg { transform: rotate(180deg); }
.ayz-faq-a {
    display: none;
    padding: 0 16px 14px;
    font-size: 13px;
    color: var(--ayz-muted);
    line-height: 1.7;
}
.ayz-faq-item.open .ayz-faq-a { display: block; }

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .ayz-gallery {
        position: static;
    }
    .ayz-inquiry {
        position: static;
    }
}

/* ─── WooCommerce Overrides ─────────────────────────────────────── */
.ayzelify-product-page .woocommerce-breadcrumb,
.ayzelify-product-page .related.products,
.ayzelify-product-page .woocommerce-tabs,
.ayzelify-product-page .product_meta,
.ayzelify-product-page .summary > .price,
.ayzelify-product-page .summary > .cart,
.ayzelify-product-page .summary > .product_title,
.ayzelify-product-page .summary > .woocommerce-product-details__short-description,
.ayzelify-product-page .woocommerce-product-gallery {
    display: none !important;
}
