/**
 * Persian Flag Template - Enhanced Frontend Styles
 */

:root {
    --primary-color: #e8b233;
    --secondary-color: #f8f8f8;
    --text-color: #333;
    --border-color: #ddd;
    --rating-color: #e8b233;
    --accent-color: #e8b233;
    --button-color: #e8b233;
    --contrast-color: #000;
    --light-text-color: #fff;
    --section-bg-color: #fff;
    --form-bg-color: #f9f9f9;
    --warning-bg-color: #fff3cd;
}

/* Increased specificity to override theme styles */
.pft-flag-template * {
    text-align: right !important;
    box-sizing: border-box !important;
    font-family: 'IRANSans', 'Tahoma', 'Arial', sans-serif !important;
}

.pft-flag-template {
    font-family: 'IRANSans', 'Tahoma', 'Arial', sans-serif !important;
    line-height: 1.7 !important;
    color: var(--text-color) !important;
    background-color: #f8f9fa !important;
    direction: rtl !important;
}

.pft-container {
    width: 100% !important;
    max-width: 1600px !important;
    margin: 0 auto !important;
    padding: 20px !important;
}

.pft-flag-template header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 0 !important;
    border-bottom: 1px solid var(--border-color) !important;
    margin-bottom: 25px !important;
}

/* Ensure our breadcrumbs don't inherit theme styles */
.pft-flag-template .breadcrumb {
    display: flex !important;
    list-style: none !important;
    padding: 10px 15px !important;
    margin: 0 0 20px 0 !important;
    background-color: var(--section-bg-color) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.pft-flag-template .breadcrumb li {
    margin-left: 10px !important;
    color: #666 !important;
    font-size: 14px !important;
}

.pft-flag-template .breadcrumb li a {
    color: var(--primary-color) !important;
    text-decoration: none !important;
    transition: color 0.3s !important;
}

.pft-flag-template .breadcrumb li a:hover {
    color: #c99a29 !important;
}

.pft-flag-template .breadcrumb li:after {
    content: ">" !important;
    margin-right: 10px !important;
    color: #999 !important;
}

.pft-flag-template .breadcrumb li:last-child:after {
    content: "" !important;
}

.pft-flag-template .product-area {
    display: grid !important;
    grid-template-columns: 4fr 1fr !important;
    gap: 30px !important;
    margin-bottom: 40px !important;
}

.pft-flag-template .product-main {
    display: grid !important;
    grid-template-columns: 1fr 1.5fr !important;
    gap: 25px !important;
}

.pft-flag-template .product-image {
    background-color: var(--section-bg-color) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08) !important;
    text-align: center !important;
    padding: 25px !important;
    position: relative !important;
}

.pft-flag-template .product-image img {
    max-width: 100% !important;
    height: auto !important;
    transition: transform 0.3s ease !important;
}

.pft-flag-template .product-image:hover img {
    transform: scale(1.03) !important;
}

.pft-flag-template .product-info {
    background-color: var(--section-bg-color) !important;
    border-radius: 8px !important;
    padding: 25px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08) !important;
}

.pft-flag-template .page-title {
    font-size: 1.6rem !important;
    margin-bottom: 30px !important;
    color: var(--text-color) !important;
    font-weight: 600 !important;
    text-align: center !important;
}

/* Fixed form spacing and layout */
.pft-flag-template .form-group {
    margin-bottom: 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important; /* Changed from center to improve alignment */
    flex-wrap: wrap !important; /* Allow wrapping on smaller screens */
}

.pft-flag-template .form-label {
    font-weight: 600 !important;
    color: #555 !important;
    flex: 0 0 30% !important; /* Fixed width for labels */
    font-size: 15px !important;
    padding-top: 10px !important; /* Add padding to align with inputs */
}

.pft-flag-template .form-control {
    width: 65% !important;
    padding: 12px 15px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    background-color: var(--form-bg-color) !important;
    transition: border-color 0.3s, box-shadow 0.3s !important;
    font-size: 14px !important;
}

.pft-flag-template .form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(232, 178, 51, 0.2) !important;
    outline: none !important;
}

.pft-flag-template .form-select {
    width: 65% !important;
    padding: 12px 15px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    appearance: none !important;
    background: var(--form-bg-color) url('data:image/svg+xml;utf8,<svg fill="%23666" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat left 10px center !important;
    padding-left: 30px !important;
    transition: border-color 0.3s, box-shadow 0.3s !important;
    font-size: 14px !important;
}

.pft-flag-template .form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(232, 178, 51, 0.2) !important;
    outline: none !important;
}

/* Improved quantity selector */
.pft-flag-template .quantity-selector {
    display: flex !important;
    align-items: center !important;
    width: 65% !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background-color: #fff !important;
    border: 2px solid #e8b233 !important;
    position: relative !important;
    height: 48px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

.pft-flag-template .quantity-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 100% !important;
    background-color: #e8b233 !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #000 !important;
    transition: all 0.2s ease !important;
    user-select: none !important;
}

.pft-flag-template .quantity-btn:hover {
    background-color: #f5c14c !important;
}

.pft-flag-template .quantity-btn:active {
    background-color: #d0a024 !important;
}

.pft-flag-template .decrease-quantity {
    border-right: 1px solid rgba(0,0,0,0.1) !important;
}

.pft-flag-template .increase-quantity {
    border-left: 1px solid rgba(0,0,0,0.1) !important;
}

.pft-flag-template .quantity-input {
    flex: 1 !important;
    width: calc(100% - 96px) !important;
    padding: 0 !important;
    height: 100% !important;
    text-align: center !important;
    border: none !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333 !important;
    background-color: transparent !important;
}

.pft-flag-template .quantity-input:focus {
    outline: none !important;
    background-color: rgba(232, 178, 51, 0.05) !important;
}

/* Prevent number input arrows in Chrome, Safari, Edge, Opera */
.pft-flag-template .quantity-input::-webkit-outer-spin-button,
.pft-flag-template .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Prevent number input arrows in Firefox */
.pft-flag-template .quantity-input {
    -moz-appearance: textfield !important;
}

.pft-flag-template .services-section {
    margin-top: 15px !important;
    width: 65% !important; /* Align with other form elements */
    margin-left: 0 !important;
    margin-right: auto !important; /* Push to the right to align with other form elements */
    border-top: 1px solid var(--border-color) !important;
    padding-top: 20px !important;
}

.pft-flag-template .services-title {
    color: var(--accent-color) !important;
    margin-bottom: 18px !important;
    position: relative !important;
    padding-right: 15px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.pft-flag-template .services-title:before {
    content: "" !important;
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 4px !important;
    height: 22px !important;
    background-color: var(--accent-color) !important;
    border-radius: 2px !important;
}

.pft-flag-template .checkbox-group {
    margin-bottom: 12px !important;
    display: flex !important;
    align-items: center !important;
    padding: 8px 0 !important;
}

.pft-flag-template .checkbox-group input[type="checkbox"] {
    margin-left: 10px !important;
    cursor: pointer !important;
    width: 18px !important;
    height: 18px !important;
    accent-color: var(--primary-color) !important;
}

.pft-flag-template .checkbox-group label {
    font-size: 14px !important;
    cursor: pointer !important;
}

.pft-flag-template .sidebar {
    background-color: var(--section-bg-color) !important;
    border-radius: 8px !important;
    padding: 0 !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08) !important;
}

.pft-flag-template .summary-box {
    background-color: var(--button-color) !important;
    color: white !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 25px !important;
}

.pft-flag-template .summary-row {
    display: flex !important;
    justify-content: space-between !important;
    margin-bottom: 15px !important;
    font-size: 16px !important;
    align-items: center !important;
}

.pft-flag-template .summary-row .price-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    background-color: white !important;
    border-radius: 50% !important;
    text-align: center !important;
    margin-left: 10px !important;
    color: var(--button-color) !important;
}

.pft-flag-template .submit-btn {
    width: 100% !important;
    padding: 16px !important;
    background-color: white !important;
    color: black !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin-top: 20px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.pft-flag-template .submit-btn:hover {
    background-color: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
}

.pft-flag-template .help-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    margin-top: 15px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    opacity: 0.9 !important;
    transition: opacity 0.3s !important;
}

.pft-flag-template .help-link:hover {
    opacity: 1 !important;
}

.pft-flag-template .help-link i {
    margin-left: 5px !important;
}

.pft-flag-template .notice-box {
    background-color: var(--warning-bg-color) !important;
    border: 1px solid #ffeeba !important;
    border-radius: 0 0 8px 8px !important;
    padding: 18px !important;
    color: #856404 !important;
}

.pft-flag-template .notice-title {
    font-weight: 600 !important;
    margin-bottom: 10px !important;
    font-size: 15px !important;
}

.pft-flag-template .delivery-section {
    margin-top: 30px !important;
}

.pft-flag-template .delivery-options {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    margin-top: 15px !important;
    width: 65% !important; /* Match other form controls */
    margin-left: 0 !important;
    margin-right: auto !important; /* Push to the right to align with other form elements */
}

.pft-flag-template .delivery-option {
    border: 2px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 15px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.pft-flag-template .delivery-option.active {
    border-color: var(--primary-color) !important;
    background-color: rgba(232, 178, 51, 0.08) !important;
    box-shadow: 0 3px 8px rgba(232, 178, 51, 0.15) !important;
}

.pft-flag-template .delivery-icon {
    font-size: 24px !important;
    margin-bottom: 10px !important;
    color: #666 !important;
}

.pft-flag-template .delivery-option.active .delivery-icon {
    color: var(--primary-color) !important;
}

.pft-flag-template .online-design-btn {
    display: block !important;
    text-align: center !important;
    padding: 14px !important;
    border: 2px solid var(--accent-color) !important;
    border-radius: 8px !important;
    color: var(--accent-color) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    margin: 20px !important;
    transition: all 0.3s ease !important;
}

.pft-flag-template .online-design-btn i {
    margin-left: 8px !important;
    transition: transform 0.3s !important;
}

.pft-flag-template .online-design-btn:hover {
    background-color: var(--accent-color) !important;
    color: white !important;
}

.pft-flag-template .online-design-btn:hover i {
    transform: translateX(-5px) !important;
}

.pft-flag-template .social-links {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 20px !important;
    font-size: 14px !important;
}

.pft-flag-template .social-link {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background-color: #f8f9fa !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #666 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.pft-flag-template .social-link:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
    transform: translateY(-3px) !important;
}

.pft-flag-template .rating-box {
    margin: 20px !important;
    background-color: #fff !important;
    border-radius: 8px !important;
    padding: 20px !important;
    border: 1px solid var(--border-color) !important;
}

.pft-flag-template .rating-header {
    display: flex !important;
    justify-content: space-between !important;
    margin-bottom: 15px !important;
    align-items: center !important;
}

.pft-flag-template .rating-count {
    background-color: var(--primary-color) !important;
    color: white !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.pft-flag-template .rating-row {
    display: flex !important;
    justify-content: space-between !important;
    margin-bottom: 12px !important;
    align-items: center !important;
}

.pft-flag-template .rating-label {
    color: #555 !important;
    font-size: 14px !important;
}

.pft-flag-template .rating-stars {
    color: var(--rating-color) !important;
    font-size: 16px !important;
}

.pft-flag-template .custom-tags {
    margin: 0 20px 20px !important;
}

.pft-flag-template .custom-tags-title {
    font-weight: 600 !important;
    margin-bottom: 12px !important;
    display: flex !important;
    align-items: center !important;
    font-size: 15px !important;
}

.pft-flag-template .heart-icon {
    color: #c92c2c !important;
    margin-left: 8px !important;
}

.pft-flag-template .tags-container {
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 15px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.pft-flag-template .product-tag {
    background-color: #f1f1f1 !important;
    color: #555 !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    transition: all 0.3s !important;
}

.pft-flag-template .product-tag:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Tab system fixes - ensure tabs always show */
.pft-flag-template .tabs {
    margin-top: 40px !important;
    width: 100% !important;
}

.pft-flag-template .tab-list {
    display: flex !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid var(--border-color) !important;
    overflow-x: auto !important;
    -ms-overflow-style: none !important;  /* Hide scrollbar in IE and Edge */
    scrollbar-width: none !important;  /* Hide scrollbar in Firefox */
}

.pft-flag-template .tab-list::-webkit-scrollbar {
    display: none !important;  /* Hide scrollbar in Chrome, Safari and Opera */
}

.pft-flag-template .tab-item {
    padding: 12px 20px !important;
    cursor: pointer !important;
    border-bottom: 3px solid transparent !important;
    white-space: nowrap !important;
    font-weight: 500 !important;
    transition: all 0.3s !important;
}

.pft-flag-template .tab-item.active {
    border-bottom-color: var(--accent-color) !important;
    color: var(--accent-color) !important;
    font-weight: 600 !important;
}

.pft-flag-template .tab-content {
    padding: 25px !important;
    background-color: #fff !important;
    border-radius: 0 0 8px 8px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08) !important;
    display: none !important;
}

.pft-flag-template .tab-content.active {
    display: block !important;
}

/* Remove the old mobile sticky price bar */
.pft-flag-template .mobile-sticky-price {
    display: none !important;
}

/* Floating cart button for mobile */
.pft-flag-template .pft-floating-cart {
    display: none !important; /* Hidden by default, shown only on mobile */
    position: fixed !important;
    bottom: 5% !important;
    left: 0 !important;
    z-index: 1000 !important;
    transition: all 0.3s ease !important;
    transform: translateX(-100%) !important;
    max-width: 250px !important;
    width: auto !important;
}

.pft-flag-template .pft-floating-cart.expanded {
    transform: translateX(0) !important;
}

.pft-flag-template .pft-cart-icon {
    position: absolute !important;
    width: 56px !important;
    height: 56px !important;
    background-color: #e8b233 !important;
    border-radius: 0 28px 28px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #000 !important;
    right: -56px !important;
    top: 0 !important;
    cursor: pointer !important;
    box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
}

.pft-flag-template .pft-cart-icon:hover {
    background-color: #f5c14c !important;
}

.pft-flag-template .pft-cart-content {
    background-color: white !important;
    padding: 16px !important;
    border-radius: 0 8px 8px 0 !important;
    box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.2) !important;
}

.pft-flag-template .pft-cart-price {
    font-weight: bold !important;
    font-size: 16px !important;
    margin-bottom: 10px !important;
}

.pft-flag-template .pft-cart-delivery {
    color: #666 !important;
    font-size: 14px !important;
    margin-bottom: 15px !important;
}

.pft-flag-template .pft-cart-button {
    background-color: #e8b233 !important;
    color: #000 !important;
    border: none !important;
    padding: 10px 15px !important;
    border-radius: 5px !important;
    font-weight: bold !important;
    width: 100% !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.pft-flag-template .pft-cart-button:hover {
    background-color: #f5c14c !important;
}

/* Show the floating cart only on mobile */
@media (max-width: 768px) {
    .pft-flag-template .pft-floating-cart {
        display: block !important;
    }

    /* Hide the regular submit button in sidebar on mobile */
    .pft-flag-template .sidebar .submit-btn {
        display: none !important;
    }
}

/* Ensure that the floating button doesn't cover other content on smaller screens */
@media (max-width: 480px) {
    .pft-flag-template .pft-floating-cart {
        bottom: 5% !important;
    }
}

/* Responsive styles */
@media (max-width: 1200px) {
    .pft-flag-template .product-area {
        grid-template-columns: 1fr !important;
    }

    .pft-flag-template .product-main {
        grid-template-columns: 1fr 1fr !important;
    }

    .pft-flag-template .sidebar {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 992px) {
    .pft-flag-template .pft-container {
        padding: 15px !important;
    }

    .pft-flag-template .product-main {
        gap: 15px !important;
    }

    .pft-flag-template .product-image,
    .pft-flag-template .product-info,
    .pft-flag-template .sidebar {
        padding: 15px !important;
    }
}

@media (max-width: 768px) {
    .pft-flag-template .product-main {
        grid-template-columns: 1fr !important;
    }

    .pft-flag-template .form-group {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .pft-flag-template .form-label {
        margin-bottom: 8px !important;
        width: 100% !important;
    }

    .pft-flag-template .form-control,
    .pft-flag-template .form-select,
    .pft-flag-template .quantity-selector,
    .pft-flag-template .services-section,
    .pft-flag-template .delivery-options {
        width: 100% !important;
    }

    .pft-flag-template .delivery-options {
        grid-template-columns: 1fr !important;
    }

    /* Add padding to bottom to prevent content from being hidden behind sticky bar */
    .pft-flag-template .pft-container {
        padding-bottom: 70px !important;
    }

    .pft-flag-template .summary-box {
        padding: 15px !important;
    }
}

@media (max-width: 576px) {
    .pft-flag-template .product-image,
    .pft-flag-template .product-info,
    .pft-flag-template .tab-content {
        padding: 12px !important;
    }

    .pft-flag-template .online-design-btn,
    .pft-flag-template .rating-box,
    .pft-flag-template .custom-tags {
        margin: 12px !important;
    }

    .pft-flag-template .page-title {
        font-size: 1.3rem !important;
    }

    .pft-flag-template .tab-item {
        padding: 10px 15px !important;
        font-size: 14px !important;
    }
}

/* Fix WooCommerce conflicts */
.pft-flag-template .woocommerce-product-gallery {
    opacity: 1 !important;
}

.pft-flag-template div.product p.price,
.pft-flag-template div.product span.price {
    display: none !important;
}

/* Completely hide theme breadcrumbs in our template */
.pft-flag-template .woocommerce-breadcrumb,
.pft-flag-template .breadcrumbs,
.pft-flag-template nav.breadcrumb,
.pft-flag-template .breadcrumb-trail,
.pft-flag-template .rank-math-breadcrumb,
.pft-flag-template .wp-block-yoast-breadcrumbs,
.pft-flag-template .wpbf-breadcrumbs,
.pft-flag-template .entry-breadcrumbs {
    display: none !important;
}

.pft-flag-template .woocommerce-tabs,
.pft-flag-template .product_meta,
.pft-flag-template .woocommerce-product-rating {
    display: none !important;
}

/* Hide quantity and cart form fields that we're replacing */
.pft-flag-template .quantity,
.pft-flag-template form.cart {
    display: none !important;
}

/* Improved error state */
.pft-flag-template .error,
.pft-flag-template .form-control.error,
.pft-flag-template .form-select.error {
    border-color: #dc3232 !important;
    background-color: rgba(220, 50, 50, 0.05) !important;
}

/* Animation for adding to cart */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pft-flag-template .animating-add-to-cart {
    animation: pulse 0.5s ease-in-out !important;
}

/* Additional styles for better contrast */
.pft-flag-template .summary-box {
    color: var(--light-text-color) !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1) !important;
}

.pft-flag-template .summary-row span {
    font-weight: 600 !important;
}

/* IRANSans font face (if we want to include it locally) */
@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSans-Regular.woff2') format('woff2'),
    url('../fonts/IRANSans-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSans-Bold.woff2') format('woff2'),
    url('../fonts/IRANSans-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}