/**
 * Shopify Product Modal Styles
 * Fifth Element Photography - v2.1.0
 */

.shopify-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10002;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.shopify-modal-content {
    background-color: #1a1a1a;
    border-radius: 8px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.shopify-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #333;
    background-color: #222;
    border-radius: 8px 8px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.shopify-modal-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
}

.shopify-modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 36px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    position: relative;
    z-index: 10003;
    pointer-events: auto;
}

.shopify-modal-close:hover {
    color: #4a90e2;
}

#shopify-product-component {
    padding: 30px;
    color: #ffffff;
}

/* Override Shopify SDK default styles */
#shopify-product-component .shopify-buy__product {
    background-color: transparent !important;
}

#shopify-product-component .shopify-buy__product__title {
    color: #ffffff !important;
    font-size: 28px !important;
    margin-bottom: 15px !important;
}

#shopify-product-component .shopify-buy__product__description {
    color: #cccccc !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
}

#shopify-product-component .shopify-buy__option-select-wrapper {
    margin-bottom: 15px !important;
}

#shopify-product-component .shopify-buy__option-select__label {
    color: #ffffff !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    display: block !important;
}

#shopify-product-component .shopify-buy__option-select__select {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border: 1px solid #444 !important;
    border-radius: 4px !important;
    padding: 12px !important;
    font-size: 16px !important;
    width: 100% !important;
}

#shopify-product-component .shopify-buy__btn {
    background-color: #4a90e2 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 14px 28px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    width: 100% !important;
    margin-top: 20px !important;
}

#shopify-product-component .shopify-buy__btn:hover {
    background-color: #357abd !important;
}

#shopify-product-component .shopify-buy__product__variant-img {
    border-radius: 8px !important;
    max-width: 100% !important;
}

/* Product Details Layout */
.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 0;
}

.product-image {
    width: 100%;
}

.product-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    max-height: 600px;
    object-fit: contain;
}

.product-info {
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #fff;
    font-weight: 600;
}

.product-description {
    color: #ccc;
    margin-bottom: 20px;
    line-height: 1.6;
}

.product-price {
    margin-bottom: 30px;
}

.product-price .price {
    font-size: 32px;
    font-weight: bold;
    color: #4a90e2;
}

.product-options {
    margin-bottom: 30px;
}

.option-group {
    margin-bottom: 25px;
}

.option-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.option-badge-full,
.option-badge-small {
    background: #2a2a2a;
    border: 2px solid #444;
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
}

.option-badge-full {
    flex: 1 1 100%;
    min-width: 100%;
}

.option-badge-small {
    flex: 0 0 auto;
    min-width: 80px;
}

.option-badge-full:hover,
.option-badge-small:hover {
    background: #333;
    border-color: #4a90e2;
}

.option-badge-full.selected,
.option-badge-small.selected {
    background: #4a90e2;
    border-color: #4a90e2;
    color: #fff;
}

.option-badge-full:disabled,
.option-badge-small:disabled,
.option-badge-full.unavailable,
.option-badge-small.unavailable {
    background: #1a1a1a;
    border-color: #333;
    color: #666;
    cursor: not-allowed;
    opacity: 0.5;
    text-decoration: line-through;
}

.availability-message {
    margin-top: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    min-height: 20px;
    color: #ccc;
}

.product-actions {
    margin-top: 30px;
}

.add-to-cart-button {
    width: 100%;
    padding: 16px;
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.add-to-cart-button:hover:not(:disabled) {
    background: #357abd;
}

.add-to-cart-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive design */
@media (max-width: 768px) {
    .shopify-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .shopify-modal-header {
        padding: 15px 20px;
        border-radius: 0;
    }

    .shopify-modal-header h2 {
        font-size: 20px;
    }

    #shopify-product-component {
        padding: 20px;
    }
    
    .product-details {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-image img {
        max-height: 300px;
    }
}

/* Cart toggle button (floating cart icon) */
.shopify-buy__cart-toggle {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    background-color: #4a90e2 !important;
    border-radius: 50% !important;
    width: 60px !important;
    height: 60px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    z-index: 9999 !important;
}

.shopify-buy__cart-toggle:hover {
    background-color: #357abd !important;
}





/* Category Selector Styles */
.category-selector {
    padding: 40px;
    text-align: center;
    color: #ffffff;
}

.category-selector h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #ffffff;
}

.category-subtitle {
    font-size: 18px;
    color: #999;
    margin-bottom: 40px;
}

.category-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 700px;
    margin: 0 auto;
}

.category-selector-btn {
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    color: #ffffff;
    text-align: left;
    width: 100%;
}

.category-selector-btn:hover {
    transform: translateY(-2px);
    border-color: #4a90e2;
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

.category-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.category-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.category-description {
    font-size: 13px;
    font-weight: 400;
    color: #aaa;
    line-height: 1.5;
}

/* Substrate Description Panel */
.substrate-description-panel {
    background: rgba(26, 26, 26, 0.95);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid rgba(66, 133, 244, 0.3);
    margin-top: 20px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.substrate-description-panel.visible {
    opacity: 1;
    max-height: 500px;
    overflow-y: auto;
}

.substrate-description-panel h4 {
    color: #4285f4;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.4;
}

.substrate-description-panel p {
    color: #e0e0e0;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.substrate-description-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.substrate-description-panel ul li {
    color: #ccc;
    font-size: 0.95rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.5;
}

.substrate-description-panel ul li:last-child {
    border-bottom: none;
}

.substrate-description-panel ul li::before {
    content: "• ";
    color: #4285f4;
    font-weight: bold;
    margin-right: 8px;
}

/* Product image container */
.product-image {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Add subtle hover effect to option badges to indicate interactivity */
.option-badge-full:hover:not(:disabled):not(.unavailable),
.option-badge-small:hover:not(:disabled):not(.unavailable) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

/* Responsive adjustments for substrate panel */
@media (max-width: 768px) {
    .substrate-description-panel {
        padding: 20px;
    }
    
    .substrate-description-panel h4 {
        font-size: 1.1rem;
    }
    
    .substrate-description-panel p {
        font-size: 0.9rem;
    }
    
    .substrate-description-panel ul li {
        font-size: 0.85rem;
    }
}

/* Back Button Styling */
.back-button {
    display: inline-flex;
    align-items: center;
    background-color: transparent;
    color: #4285f4;
    border: 1px solid #4285f4;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.back-button:hover {
    background-color: #4285f4;
    color: #ffffff;
}

.back-button svg {
    flex-shrink: 0;
}
