/* Custom CSS for PORTERS COFFEE */
/* ZENLIN ROAST adjustments */

/* Prevent horizontal scroll on mobile */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

main {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

section {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Custom font for logo */
.font-serif {
    font-family: 'Times New Roman', Times, serif;
}

/* Swiper Custom Styles */
.product-swiper {
    padding: 0 0 50px 0;
    overflow: hidden; /* 横スクロールを防止 */
    width: 100%;
    max-width: 100%;
}

/* Prevent horizontal scroll from swiper-wrapper transform */
.product-swiper .swiper-wrapper {
    overflow: visible;
}

.product-swiper .swiper-container {
    overflow: hidden;
    width: 100%;
}

.product-swiper .swiper-slide {
    transition: opacity 0.3s ease;
}

/* 非アクティブなスライドを半透明に */
.product-swiper .swiper-slide:not(.swiper-slide-active) {
    opacity: 0.5;
}

/* 商品カードのホバーエフェクト */
.product-swiper .swiper-slide article:hover {
    transform: translateY(-4px);
    transition: transform 0.2s ease;
}

.swiper-button-next,
.swiper-button-prev {
    color: #000;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 18px;
    font-weight: bold;
}

.swiper-pagination {
    bottom: 0;
}

.swiper-pagination-fraction {
    color: #666;
    font-size: 14px;
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Custom focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* Ensure images maintain aspect ratio */
img {
    max-width: 100%;
    height: auto;
}

/* Product image styling for vertical images */
.product-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

/* Gold accent utilities (for minimal custom styling alongside Tailwind) */
:root {
    --zen-gold: #C8A858; /* subdued gold */
}
.text-gold { color: var(--zen-gold); }
.border-gold { border-color: var(--zen-gold); }
.bg-gold { background-color: var(--zen-gold); }

/* Custom hover effects for product cards */
article:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* Mobile menu animation */
#mobile-menu {
    transition: all 0.3s ease;
}

#mobile-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
}

#mobile-menu:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

/* Custom button styles */
.btn-primary {
    @apply bg-black text-white px-8 py-3 hover:bg-gray-800 transition-colors;
}

/* Ensure proper spacing for mobile */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Custom grid adjustments for better mobile experience */
@media (max-width: 640px) {
    .grid-cols-1 {
        gap: 1.5rem;
    }
}

/* Hero YouTube Video Background */
#hero-video-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

#hero-youtube-player {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 177.78vh; /* 16:9 aspect ratio based on height */
    height: 56.25vw; /* 16:9 aspect ratio based on width */
    min-width: 100%;
    min-height: 100%;
    pointer-events: none;
}

#hero-youtube-player iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 177.78vh;
    height: 56.25vw;
    min-width: 100%;
    min-height: 100%;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    a {
        text-decoration: underline;
    }
}

/* Company Information - CSS Content */
.company-name::before {
    content: "合同会社ユニオン";
}

.company-representative::before {
    content: "廣橋由美子（ヒロハシ　ユミコ）";
}

.company-postal::before {
    content: "811-3512";
}

.company-address::before {
    content: "福岡県宗像市鐘崎２１９番地６";
}

.company-phone::before {
    content: "050-1791-9159";
}

/* Legal Information (特定商取引法に基づく表記) - CSS Content */
.law-company-name::before {
    content: "合同会社ユニオン";
}

.law-business-owner::before {
    content: "廣橋由美子（ヒロハシ　ユミコ）";
}

.law-business-address::before {
    content: "〒811-3512\A福岡県宗像市鐘崎２１９番地６";
    white-space: pre-line;
}

.law-business-contact::before {
    content: "電話番号：050-1791-9159\Aメール：お問い合わせフォームよりご連絡ください";
    white-space: pre-line;
}

.law-business-hours::before {
    content: "営業時間：予約制\A定休日：不定休（予約時にご確認ください）";
    white-space: pre-line;
}

.law-sales-price::before {
    content: "販売価格は、税込み表記となっております。\Aまた、別途配送料が掛かる場合もございます。配送料に関しては商品詳細ページをご確認ください。";
    white-space: pre-line;
}

.law-payment-method::before {
    content: "支払方法：クレジットカード決済のみご利用いただけます。\A支払時期：商品注文確定時にお支払いが確定いたします。\Aご来店時に店内でカード決済をお願いいたします。";
    white-space: pre-line;
}

.law-delivery-time::before {
    content: "当ショップは予約制となっております。\Aご来店予約確定後、お引渡しは早くて30分、説明が長引くと1時間ほどかかりますので、その後のご予定は余裕を持たせておいてください。\A配送をご希望の場合は、予約確定後、発送まで1週間程度かかります。";
    white-space: pre-line;
}

.law-return-policy::before {
    content: "商品に欠陥がある場合をのぞき、基本的には返品には応じません。\A商品の品質に問題がある場合は、お問い合わせフォームよりご連絡ください。";
    white-space: pre-line;
}

/* -------------------------------------------------- */
/* Minimal shared form utilities (non-intrusive)       */
/* -------------------------------------------------- */
.form-group { position: relative; }

.form-input {
    width: 100%;
    padding: 1rem 0.75rem 0.5rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 16px; /* iOS Safariで自動ズームを防ぐため16px以上に設定 */
    background-color: transparent;
    height: 56px;
    box-sizing: border-box;
}

/* Textarea should grow and respect rows */
textarea.form-input {
    height: auto;
    min-height: 8.5em; /* ~5行程度（行高依存） */
    line-height: 1.5;
    resize: vertical;
}

.form-input:focus {
    outline: none;
    border-color: #1a73e8;
    border-width: 2px;
    box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.2);
}

.form-label {
    position: absolute;
    left: 0.75rem;
    top: 1rem;
    color: #5f6368;
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.2s;
    transform-origin: left top;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label,
.form-input.has-value + .form-label {
    transform: translateY(-1.5rem) scale(0.75);
    color: #1a73e8;
    background-color: white;
    padding: 0 4px;
    left: 0.5rem;
}

.form-input.has-value {
    padding-top: 1.25rem;
    padding-bottom: 0.75rem;
}

.form-select {
    width: 100%;
    padding: 1rem 3rem 1rem 0.75rem !important; /* 右側に矢印分のスペースを確保（増やしました） */
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 16px; /* iOS Safariで自動ズームを防ぐため16px以上に設定 */
    background-color: white;
    height: 56px;
    box-sizing: border-box;
    /* 全てのブラウザでデフォルトの矢印を非表示 */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    /* カスタム矢印アイコン */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
}

.form-select:focus {
    outline: none;
    border-color: #1a73e8;
    border-width: 2px;
    box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.2);
}

.form-select:focus + .form-label,
.form-select:not(:invalid) + .form-label,
.form-select.has-value + .form-label {
    transform: translateY(-1.5rem) scale(0.75);
    color: #1a73e8;
    background-color: white;
    padding: 0 4px;
    left: 0.5rem;
}

/* エラー時のスタイル（ユーザーが操作した後にのみ表示） */
.form-input.touched:invalid:not(:placeholder-shown),
.form-input.border-red-500 {
    border-color: #ef4444;
    border-bottom-color: #ef4444;
}

.form-input.touched:invalid:not(:placeholder-shown) + .form-label,
.form-input.border-red-500 + .form-label {
    color: #ef4444;
}

.form-select.touched:invalid,
.form-select.border-red-500 {
    border-color: #ef4444;
    border-bottom-color: #ef4444;
}

.form-select.touched:invalid + .form-label,
.form-select.border-red-500 + .form-label {
    color: #ef4444;
}

/* エラーメッセージ */
.error-message {
    display: block;
}

.error-message.hidden {
    display: none;
}

.required-mark { color: #d93025; margin-left: 2px; }
