/**
 * Page Section Styles
 * Frontend rendering of page builder sections
 */

.page-container {
    width: 100%;
    overflow-x: hidden;
}

/* Prevent horizontal scroll from 100vw elements */
html, body {
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.section-subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

/* Hero Section */
.section-hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    text-align: center;
    padding: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 24px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-button {
    display: inline-block;
    padding: 15px 40px;
    background: #d4af37;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 500;
    transition: background 0.3s;
}

.hero-button:hover {
    background: #b8941f;
}

/* Text Block Section */
.section-text-block {
    padding: 20px;
    background: white;
}

.text-content {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    max-width: 900px;
    margin: 0 auto;
}

.text-content p {
    margin-bottom: 15px;
}

.text-content h1, .text-content h2, .text-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #333;
}

.text-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

/* Product Grid Section */
.section-product-grid {
    padding: 20px;
    background: #f9f9f9;
}

.section-product-grid .container {
    width: 100%;
}

/* Full-width product grid - edge to edge */
.section-product-grid.full-width {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding: 40px 30px;
    box-sizing: border-box;
}

.section-product-grid.full-width .product-grid {
    max-width: none;
}

.product-grid {
    display: grid;
    gap: 30px;
    margin-top: 40px;
    width: 100%;
}

.product-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
    min-height: 36px;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 8px;
}

.product-original-price {
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
}

.product-add-cart {
    width: 100%;
    padding: 12px;
    background: #d4af37;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.product-add-cart:hover {
    background: #b8941f;
}

/* Product Carousel Section */
.section-product-carousel {
    padding: 20px;
    background: white;
}

.product-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 20px 0;
}

.carousel-item {
    min-width: 280px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    scroll-snap-align: start;
    text-align: center;
}

.carousel-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
}

.carousel-item h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.carousel-item p {
    font-size: 18px;
    font-weight: 700;
    color: #d4af37;
}

/* Contact Form Section */
.section-contact-form {
    padding: 20px;
    background: #f9f9f9;
}

.contact-form {
    max-width: 600px;
    margin: 40px auto 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #d4af37;
}

.form-group textarea {
    resize: vertical;
}

.form-submit {
    width: 100%;
    padding: 15px;
    background: #d4af37;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.form-submit:hover {
    background: #b8941f;
}

/* Newsletter Form Section */
.section-newsletter-form {
    padding: 20px;
    background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
    color: white;
    text-align: center;
}

.section-newsletter-form .section-title,
.section-newsletter-form .section-subtitle {
    color: white;
}

.newsletter-form {
    max-width: 500px;
    margin: 30px auto 0;
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
}

.newsletter-form button {
    padding: 15px 30px;
    background: white;
    color: #d4af37;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.newsletter-form button:hover {
    background: #f5f5f5;
}

.privacy-text {
    margin-top: 15px;
    font-size: 14px;
    opacity: 0.9;
}

/* Image Gallery Section */
.section-image-gallery {
    padding: 20px;
    background: white;
}

.image-gallery {
    display: grid;
    gap: 20px;
    margin-top: 40px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Heading Section */
.section-heading {
    padding: 10px 20px;
}

/* Image Section */
.section-image {
    padding: 0;
    margin: 0;
}

/* Video Section */
.section-video {
    padding: 10px 20px;
}

/* Button Section */
.section-button {
    padding: 10px 20px;
}

.btn-custom:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Divider Section */
.section-divider {
    padding: 5px 20px;
}

/* Spacer Section */
.section-spacer {
    width: 100%;
}

/* Gallery Section */
.section-gallery {
    padding: 10px 20px;
}

.section-gallery .gallery-item {
    transition: transform 0.3s;
}

.section-gallery .gallery-item:hover {
    transform: scale(1.02);
}

/* Testimonial Section */
.section-testimonial {
    padding: 20px;
}

.testimonial-card blockquote::before {
    content: '"';
    font-size: 60px;
    position: absolute;
    top: -20px;
    left: 20px;
    opacity: 0.1;
}

/* Social Icons Section */
.section-social-icons {
    padding: 10px 20px;
}

.section-social-icons a:hover {
    opacity: 0.8;
    transform: translateY(-3px);
}

/* Map Section */
.section-map {
    padding: 10px 20px;
}

/* Newsletter Section */
.section-newsletter {
    padding: 20px;
}

/* FAQ Section */
.section-faq {
    padding: 20px;
}

.faq-question:hover {
    background: #f3f4f6;
}

/* Pricing Table Section */
.section-pricing-table {
    padding: 20px;
}

.pricing-card {
    transition: transform 0.3s;
}

.pricing-card:hover {
    transform: scale(1.02) !important;
}

/* HTML Section */
.section-html {
    padding: 20px;
}

/* Columns Section */
.section-columns {
    padding: 0;
}

.section-columns .container {
    padding: 0;
}

/* Full-width columns - true edge-to-edge */
.section-columns.full-width-section {
    width: 100vw !important;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 !important;
    margin: 0 !important;
}

.section-columns.full-width-section > div {
    padding: 0 !important;
    max-width: none !important;
}

/* Testimonial Slider Section */
.section-testimonial-slider {
    padding: 60px 20px;
}

.section-testimonial-slider .ts-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px;
    text-align: center;
}

.section-testimonial-slider .ts-subtitle {
    font-size: 16px;
    margin: 0 0 40px;
    text-align: center;
}

.section-testimonial-slider .ts-slider {
    position: relative;
    overflow: hidden;
}

.section-testimonial-slider .ts-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s ease;
}

.section-testimonial-slider .ts-card {
    flex: 0 0 calc((100% - var(--ts-gap, 40px)) / var(--ts-per-view, 3));
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    box-sizing: border-box;
}

.section-testimonial-slider .ts-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 24px;
    overflow: hidden;
}

.section-testimonial-slider .ts-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-testimonial-slider .ts-stars {
    font-size: 18px;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.section-testimonial-slider .ts-quote {
    font-size: 15px;
    font-style: italic;
    line-height: 1.6;
    margin: 0 0 15px;
    opacity: 0.9;
}

.section-testimonial-slider .ts-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.section-testimonial-slider .ts-role {
    font-size: 13px;
}

.section-testimonial-slider .ts-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.section-testimonial-slider .ts-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    padding: 0;
}

.section-testimonial-slider .ts-dot:hover {
    transform: scale(1.3);
}

.section-testimonial-slider .ts-dot-active {
    transform: scale(1.2);
}

/* Custom Order Form Section */
.section-custom-order-form {
    padding: 40px 20px;
}

.section-custom-order-form .container {
    max-width: 900px;
}

.cof-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #dc2626;
}

.cof-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cof-description {
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    opacity: 0.8;
}

.cof-section {
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.cof-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
}

.cof-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

.cof-section-title {
    flex: 1;
}

.cof-section-body {
    padding: 20px 16px;
}

.cof-field {
    margin-bottom: 16px;
}

.cof-field:last-child {
    margin-bottom: 0;
}

.cof-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: inherit;
}

.cof-required {
    color: #dc2626;
}

.cof-field input[type="text"],
.cof-field input[type="email"],
.cof-field input[type="tel"],
.cof-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background: #ffffff;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.cof-field input:focus,
.cof-field textarea:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.cof-field textarea {
    resize: vertical;
    min-height: 80px;
}

.cof-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.cof-checkbox {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-weight: 400 !important;
    font-size: 14px !important;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.cof-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #dc2626;
    cursor: pointer;
}

.cof-file-upload {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.cof-file-upload:hover {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.03);
}

.cof-file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.cof-file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    color: #6b7280;
}

.cof-file-icon {
    font-size: 28px;
}

.cof-file-upload-label small {
    font-size: 12px;
    opacity: 0.7;
}

.cof-file-preview {
    margin-top: 12px;
    text-align: center;
}

.cof-file-preview img {
    border: 1px solid #e5e7eb;
}

.cof-submit-area {
    text-align: center;
    margin-top: 30px;
}

.cof-submit-btn {
    display: inline-block;
    padding: 14px 48px;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.cof-submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.cof-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cof-message {
    margin-top: 16px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

.cof-message-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.cof-message-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Responsive Visibility Classes */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hide-tablet {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 48px;
    }

    .hero-subtitle {
        font-size: 20px;
    }

    .section-title {
        font-size: 32px;
    }

    .pricing-grid {
        grid-template-columns: 1fr !important;
    }

    .columns-layout {
        flex-direction: column !important;
    }

    .columns-layout .column {
        flex: 1 1 100% !important;
    }

    .section-testimonial-slider .ts-card {
        flex: 0 0 calc((100% - 20px) / 2) !important;
    }

    .section-testimonial-slider .ts-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .section-title {
        font-size: 28px;
    }

    .product-grid {
        gap: 20px;
    }

    .image-gallery {
        gap: 20px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .section-title {
        font-size: 24px;
    }

    .product-grid {
        grid-template-columns: 1fr !important;
    }

    .image-gallery {
        grid-template-columns: 1fr !important;
    }

    .gallery-grid {
        grid-template-columns: 1fr !important;
    }

    .social-icons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .section-testimonial-slider .ts-card {
        flex: 0 0 100% !important;
    }

    .section-testimonial-slider .ts-title {
        font-size: 24px;
    }

    .section-testimonial-slider {
        padding: 40px 15px;
    }

    .cof-title {
        font-size: 22px;
    }

    .cof-checkbox-group {
        flex-direction: column;
        gap: 8px;
    }

    .cof-submit-btn {
        width: 100%;
        padding: 14px 20px;
    }
}

/* Image Carousel Section */
.section-image-carousel {
    padding: 20px;
    background: white;
}

.ic-slider {
    position: relative;
    overflow: hidden;
}

.ic-track {
    display: flex;
    gap: var(--ic-gap, 20px);
    transition: transform 0.5s ease;
}

.ic-slide {
    flex: 0 0 calc((100% - var(--ic-gap, 20px) * (var(--ic-per-view, 3) - 1)) / var(--ic-per-view, 3));
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.ic-slide img {
    width: 100%;
    height: var(--ic-height, 400px);
    object-fit: cover;
    display: block;
}

.ic-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background 0.3s, transform 0.3s;
    z-index: 2;
}

.ic-arrow:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.ic-arrow-prev {
    left: 12px;
}

.ic-arrow-next {
    right: 12px;
}

.ic-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.ic-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.3s, transform 0.3s;
}

.ic-dot:hover {
    transform: scale(1.3);
}

.ic-dot-active {
    background: #3b82f6;
    transform: scale(1.2);
}

.ic-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 20px 15px 12px;
    font-size: 14px;
    line-height: 1.4;
}

/* Image Carousel: Grid-stacked base (all non-default transitions) */
.ic-transition-fade .ic-track,
.ic-transition-slide-right .ic-track,
.ic-transition-pixel-fade .ic-track,
.ic-transition-pixel-wipe .ic-track {
    display: grid;
    grid-template-columns: 1fr;
    transform: none !important;
}

.ic-transition-fade .ic-slide,
.ic-transition-slide-right .ic-slide,
.ic-transition-pixel-fade .ic-slide,
.ic-transition-pixel-wipe .ic-slide {
    grid-row: 1;
    grid-column: 1;
    opacity: 0;
    pointer-events: none;
}

/* Fade: smooth crossfade */
.ic-transition-fade .ic-slide {
    transition: opacity var(--ic-speed, 500ms) ease;
}
.ic-transition-fade .ic-slide.ic-slide-active {
    opacity: 1;
    pointer-events: auto;
}

/* Slide Right: new slide enters from the left */
.ic-transition-slide-right .ic-slide.ic-slide-active {
    animation: icSlideInFromLeft var(--ic-speed, 500ms) ease forwards;
    pointer-events: auto;
}
@keyframes icSlideInFromLeft {
    from { opacity: 0; transform: translateX(-100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* Pixel Fade: digital stepped dissolve */
.ic-transition-pixel-fade .ic-slide.ic-slide-active {
    animation: icPixelFadeIn var(--ic-speed, 500ms) steps(8) forwards;
    pointer-events: auto;
}
@keyframes icPixelFadeIn {
    0% { opacity: 0; filter: contrast(2) brightness(1.5); }
    100% { opacity: 1; filter: contrast(1) brightness(1); }
}

/* Pixel Wipe: horizontal block reveal */
.ic-transition-pixel-wipe .ic-slide.ic-slide-active {
    animation: icPixelWipeIn var(--ic-speed, 500ms) steps(12) forwards;
    pointer-events: auto;
}
@keyframes icPixelWipeIn {
    from { opacity: 1; clip-path: inset(0 100% 0 0); }
    to { opacity: 1; clip-path: inset(0 0 0 0); }
}

/* Image Carousel Responsive */
@media (max-width: 768px) {
    .ic-slide {
        flex: 0 0 calc((100% - var(--ic-gap, 20px)) / 2);
    }

    .ic-arrow {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .ic-arrow-prev {
        left: 8px;
    }

    .ic-arrow-next {
        right: 8px;
    }
}

@media (max-width: 480px) {
    .ic-slide {
        flex: 0 0 100%;
    }

    .section-image-carousel {
        padding: 15px 10px;
    }
}
