/* ==========================================================================
   Quick View Modal
   ========================================================================== */
.quick-view-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.quick-view-modal {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.quick-view-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--charcoal);
    line-height: 1;
    transition: color 0.3s;
}

.quick-view-close:hover { color: var(--gold); }

.quick-view-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.quick-view-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--cream-dark);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Content + Sidebar Layout
   ========================================================================== */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 4rem;
    align-items: start;
}

.content-with-sidebar.no-sidebar {
    grid-template-columns: 1fr;
}

@media (max-width: 992px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    .sidebar { padding-left: 0; }
}

/* ==========================================================================
   WooCommerce Page Layout
   ========================================================================== */
.woo-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 4rem;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 4rem;
    align-items: start;
}

@media (max-width: 992px) {
    .woo-content-wrapper {
        grid-template-columns: 1fr;
        padding: 2rem;
    }
}

/* Single product layout override */
.woocommerce div.product {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 4rem !important;
    align-items: start !important;
}

.woocommerce div.product .woocommerce-product-gallery { grid-column: 1; }
.woocommerce div.product .summary { grid-column: 2; }
.woocommerce div.product .woocommerce-tabs { grid-column: 1 / -1; }
.woocommerce div.product .related { grid-column: 1 / -1; }

@media (max-width: 768px) {
    .woocommerce div.product {
        grid-template-columns: 1fr !important;
    }
    .woocommerce div.product .woocommerce-product-gallery,
    .woocommerce div.product .summary {
        grid-column: 1 !important;
    }
}

/* ==========================================================================
   Newsletter success / error states
   ========================================================================== */
.newsletter-form .form-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}
.newsletter-form .form-message.success {
    background: rgba(27, 77, 62, 0.3);
    color: #a8e6c5;
}
.newsletter-form .form-message.error {
    background: rgba(196, 88, 59, 0.3);
    color: #f5b3a0;
}

/* ==========================================================================
   Single Article (Blog Post)
   ========================================================================== */
.single-article {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    padding: 0 0 3rem;
}

.single-article .entry-featured-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.single-article .entry-header {
    padding: 2rem 3rem 0;
}

.single-article .entry-content {
    padding: 1.5rem 3rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.single-article .entry-content h2,
.single-article .entry-content h3 {
    margin: 2rem 0 1rem;
}

.single-article .entry-content p {
    margin-bottom: 1.5rem;
}

.single-article .entry-content img {
    border-radius: 8px;
    margin: 1.5rem 0;
}

.single-article .entry-footer {
    padding: 0 3rem;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem 0;
    border-top: 1px solid var(--cream-dark);
    margin-top: 2rem;
}

.post-navigation a {
    color: var(--indigo);
    font-weight: 600;
}

/* ==========================================================================
   Page Hero subtle animation
   ========================================================================== */
.page-hero {
    animation: fadeSlideUp 0.6s ease forwards;
}

/* ==========================================================================
   No Products placeholder pattern
   ========================================================================== */
.product-image-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 20%;
    opacity: 0.4;
}

.product-image-placeholder::before,
.product-image-placeholder::after {
    content: none;
}

/* Use a CSS-only weave pattern */
.product-image-wrap {
    position: relative;
}

/* Ensure image fills the wrap properly when no image */
.product-image-wrap > div:not(.product-badge):not(.quick-view-btn) {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--cream-dark) 0%, #d5cdc0 50%, var(--cream-dark) 100%);
    background-size: 20px 20px;
    background-image:
        repeating-linear-gradient(45deg, rgba(201,162,39,0.1) 0px, rgba(201,162,39,0.1) 1px, transparent 1px, transparent 10px),
        repeating-linear-gradient(-45deg, rgba(26,27,75,0.08) 0px, rgba(26,27,75,0.08) 1px, transparent 1px, transparent 10px);
}

/* ==========================================================================
   Blog Layout — Alignment Fixes
   ========================================================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    align-items: start;
}

.entry-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.entry-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.entry-thumbnail {
    height: 260px;
    overflow: hidden;
    flex-shrink: 0;
}

.entry-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.entry-card:hover .entry-thumbnail img { transform: scale(1.05); }

.entry-content-wrap {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.entry-meta {
    font-size: 0.82rem;
    color: var(--gold);
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.entry-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--indigo-deep);
    margin-bottom: 1rem;
    line-height: 1.3;
    flex-shrink: 0;
}

.entry-title a { color: inherit; text-decoration: none; }
.entry-title a:hover { color: var(--gold); }

.entry-excerpt {
    color: var(--charcoal);
    opacity: 0.7;
    font-size: 0.95rem;
    line-height: 1.7;
    flex: 1;
    margin-bottom: 1.5rem;
}

.entry-card .btn {
    align-self: flex-start;
    flex-shrink: 0;
}

/* Equal-height card row alignment */
.blog-grid .entry-card {
    display: flex;
    flex-direction: column;
}

/* No thumbnail fallback */
.entry-card.no-thumbnail .entry-content-wrap {
    padding-top: 2.5rem;
}

/* Single post content */
.single-article .entry-content {
    max-width: 800px;
}
.single-article .entry-content > * { margin-bottom: 1.5rem; }
.single-article .entry-content h2 { font-size: 1.8rem; margin-top: 2.5rem; }
.single-article .entry-content h3 { font-size: 1.4rem; margin-top: 2rem; }
.single-article .entry-content ul,
.single-article .entry-content ol {
    padding-left: 2rem;
    list-style: disc;
}
.single-article .entry-content blockquote {
    border-left: 4px solid var(--gold);
    padding: 1rem 1.5rem;
    background: var(--cream);
    margin: 2rem 0;
    font-style: italic;
    color: var(--indigo);
}

/* ==========================================================================
   Plugin Compatibility CSS
   ========================================================================== */

/* Yoast SEO breadcrumbs */
.yoast-breadcrumb {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.5rem;
}
.yoast-breadcrumb a { color: var(--gold-light); text-decoration: none; }

/* Contact Form 7 */
.wpcf7 .wpcf7-form-control {
    font-family: var(--font-body);
    border: 1px solid var(--cream-dark);
    padding: 0.9rem 1.2rem;
    border-radius: 6px;
    width: 100%;
    background: white;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}
.wpcf7 .wpcf7-form-control:focus { border-color: var(--gold); outline: none; }
.wpcf7 .wpcf7-submit {
    background: var(--indigo) !important;
    color: white !important;
    border: none;
    padding: 1rem 2.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 0;
}
.wpcf7 .wpcf7-submit:hover { background: var(--gold) !important; color: var(--indigo) !important; }

/* WPForms */
.wpforms-container .wpforms-field input,
.wpforms-container .wpforms-field textarea,
.wpforms-container .wpforms-field select {
    border: 1px solid var(--cream-dark) !important;
    border-radius: 6px !important;
    font-family: var(--font-body) !important;
}
.wpforms-container .wpforms-field input:focus,
.wpforms-container .wpforms-field textarea:focus { border-color: var(--gold) !important; }
.wpforms-submit { background: var(--indigo) !important; color: white !important; }

/* Elementor widget overrides — ensure theme fonts take priority */
.elementor-widget-heading .elementor-heading-title { font-family: var(--font-heading); }
.elementor-widget-text-editor { font-family: var(--font-body); }

/* Elementor full-width page (no header/footer padding) */
body.elementor-page .site-section { padding-top: 0; }

/* WooCommerce Elementor product widget */
.elementor-widget-woocommerce-products .products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem !important;
}
@media (max-width: 992px) {
    .elementor-widget-woocommerce-products .products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 480px) {
    .elementor-widget-woocommerce-products .products {
        grid-template-columns: 1fr !important;
    }
}

/* Gravity Forms */
.gform_wrapper .gform_body input,
.gform_wrapper .gform_body textarea,
.gform_wrapper .gform_body select {
    font-family: var(--font-body) !important;
    border: 1px solid var(--cream-dark) !important;
    border-radius: 6px !important;
    padding: 0.9rem 1.2rem !important;
}
.gform_button { background: var(--indigo) !important; color: white !important; }

/* Table base styles */
table { width: 100%; border-collapse: collapse; }
table th { background: var(--indigo); color: white; padding: 1rem; text-align: left; font-weight: 600; }
table td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--cream-dark); }
table tr:hover td { background: var(--cream); }
