/* Original product page stylesheet, extracted without changing the theme. */
.commerce-product > main {
    --primary: #171717;
    --primary-dark: #404040;
    --primary-light: #737373;
    --secondary: #404040;
    --accent: #525252;
    --dark: #262626;
    --light: #fafafa;
    --gray: #737373;
    --light-gray: #e5e5e5;
    --white: #ffffff;
    --bg-accent: #f5f5f5;
    --text-primary: #171717;
    --text-secondary: #737373;
    --text-muted: #a3a3a3;
    --border-color: #e5e5e5;
    --danger: #ef476f;
    --success: #404040;
    --warning: #e5e5e5;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f3f3f3;
    color: #262626;
    line-height: 1.6;
}

/* Dynamic font family based on language */
body {
    font-family: "Almarai", sans-serif;
}

/* French and English use Segoe UI */
body[lang="fr"],
body[lang="en"] {
    font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
}

/* Arabic uses Almarai (default) */
body[lang="ar"] {
    font-family: "Almarai", "Tajawal", sans-serif;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: var(--transition);
    font-family: inherit;
}

.back-btn:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.header-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.header-btn.secondary {
    background: var(--bg-accent);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.header-btn.secondary:hover {
    background: var(--border-color);
}

/* Main Content */
.main-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Product Layout */
.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 50px;
}

@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr;
    }
}

/* Product Gallery */
.gallery-section {
    background: var(--white);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.main-image-container {
    position: relative;
    aspect-ratio: 1/1;
    background: var(--light-gray);
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.main-image.active {
    display: block;
}

.image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--white);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.prev-btn { inset-inline-start: 15px; }
.next-btn { inset-inline-end: 15px; }

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 15px;
}

.thumbnail {
    aspect-ratio: 1/1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.thumbnail.active, .thumbnail:hover {
    border-color: var(--primary);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Info */
.product-info {
    background: #fcfcfc;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    padding: 5px 15px;
    box-shadow: var(--shadow-sm);
}

.product-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark);
    font-family: inherit;
}

/* Order Form */
.order-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 5px 20px 10px 20px;
    box-shadow: var(--shadow-md);
    position: sticky;
    border:1px solid #5c5c5c;
    top: 20px;
}

.order-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #262626;
    position: relative;
    padding-bottom: 5px;
    text-align: start;
    font-family: inherit;
}

.order-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 48%;
    height: 3px;
    background: linear-gradient(90deg, #171717, #404040);
    border-radius: 3px;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    color: var(--dark);
    font-family: inherit;
}

.quantity-label {
    display: block;
    font-size: 17px;
    color: var(--dark);
    font-weight: 700;
    margin-bottom: 8px;
    font-family: inherit;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-gray);
    background-color: #fafafa;
    border-radius: var(--radius-md);
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.1);
}

/* Quantity Selector */
.quantity-section {
    margin-bottom: 10px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    width: fit-content;
    overflow: hidden;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.quantity-btn:hover {
    background: #d4d4d4;
}

.quantity-input {
    width: 79px;
    height: 40px;
    border: none;
    font-size: 19px;
    text-align: center;
    font-weight: 500;
    font-family: inherit;
}

/* Order Button */
.order-button {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.order-button:hover {
    background: var(--primary-dark);
}

/* Error Messages */
.error-message {
    color: var(--danger);
    font-size: 13px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}

/* Similar Products */
.similar-section {
    margin-top: 50px;
}

.similar-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--dark);
    font-family: inherit;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-card-content {
    padding: 15px;
}

.product-card-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    font-family: inherit;
}

.product-card-button {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.product-card-button:hover {
    background: var(--primary-dark);
}

/* Footer */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--light-gray);
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
    font-family: inherit;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Not Available */
.not-available {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: var(--gray);
    font-size: 18px;
    font-family: inherit;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .order-section {
        position: static;
    }

}

@media (max-width: 480px) {
    .product-title {
        font-size: 20px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}

.grecaptcha-badge { 
    visibility: hidden;
}

.size-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.size-button {
    padding: 12px 16px;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 50px;
    border-radius: 5px;
    text-align: center;
    font-family: inherit;
}

.size-button:hover {
    border-color: #171717;
    background: rgba(23, 23, 23, 0.05);
}

.size-button.selected {
    background-color: #171717;
    color: white;
    border-color: #171717;
}

/* Product Meta Section */
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 0 0;
    padding: 4px 15px;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.delivery-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: bold;
    font-family: inherit;
}

.delivery-badge i {
    font-size: 20px;
    color: var(--secondary);
}

.price-display {
    display: flex;
    align-items: center;
    gap: 4px;
}

.price-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    font-family: inherit;
}

.price-currency {
    font-size: 16px;
    color: var(--text-secondary);
    font-family: inherit;
}

/* Product Description */
.product-description {
    margin: 10px 0;
    padding: 10px 15px;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.section-heading {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
    position: relative;
    padding-bottom: 6px;
    font-family: inherit;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary);
}

.description-content {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 15px;
    font-family: inherit;
}

/* Size Selection */
.size-selection {
    margin: 25px 0;
    padding: 20px;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.size-pill {
    padding: 10px 15px;
    min-width: 50px;
    text-align: center;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-family: inherit;
}

.size-pill:hover {
    border-color: var(--primary);
    background-color: rgba(23, 23, 23, 0.05);
}

.size-pill.selected {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

#sizeError {
    display: none;
    color: #ef476f;
    font-size: 13px;
    margin-top: 5px;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}

#sizeError.show {
    display: flex;
}

/* Saved Info Banner Styles */
.saved-info-banner {
    background: #f5f5f5;
    border: 1px solid #737373;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.5s ease forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.saved-info-banner a {
    color: #f44336;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.saved-info-banner a:hover {
    text-decoration: underline;
}

/* Save Info Checkbox */
.save-info-container {
    margin-top: 15px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.save-info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    font-family: inherit;
}

.save-info-checkbox {
    width: 16px;
    height: 16px;
}

/* Ensure all elements inherit font */
.commerce-product main * {
    font-family: inherit;
}

/* RTL/LTR specific adjustments */
[dir="rtl"] .breadcrumb i {
    transform: rotate(180deg);
}

[dir="ltr"] .breadcrumb i {
    transform: none;
}
